001/* 
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.apache.commons.exec.environment;
019
020//import java.io.BufferedReader;
021//import java.io.IOException;
022//import java.util.HashMap;
023//import java.util.Map;
024//
025//import org.apache.commons.exec.CommandLine;
026
027/**
028 * Helper class to determine the environment variable
029 * for VMS.
030 *
031 * @version $Id: OpenVmsProcessingEnvironment.java 1557346 2014-01-11 11:30:16Z sebb $
032 * @deprecated No longer needed
033 */
034@Deprecated
035public class OpenVmsProcessingEnvironment extends DefaultProcessingEnvironment {
036
037    /*
038     * Hopefully removing super-class overrides won't cause Clirr error.
039     * If necessary can just delegate to super-class. 
040     */
041
042//    /**
043//     * Find the list of environment variables for this process.
044//     *
045//     * @return a map containing the environment variables
046//     * @throws IOException the operation failed
047//     */    
048//    @Override
049//    protected Map<String, String> createProcEnvironment() throws IOException {
050//        if (procEnvironment == null) {
051//            final BufferedReader in = runProcEnvCommand();
052//            procEnvironment = addVMSenvironmentVariables(new HashMap<String, String>(), in);
053//        }
054//
055//        return procEnvironment;
056//    }
057//
058//    /**
059//     * Determine the OS specific command line to get a list of environment
060//     * variables.
061//     *
062//     * @return the command line
063//     */    
064//    @Override
065//    protected CommandLine getProcEnvCommand() {
066//        final CommandLine commandLine = new CommandLine("show");
067//        commandLine.addArgument("symbol/global"); // the parser assumes symbols are global
068//        commandLine.addArgument("*");
069//        return commandLine;
070//    }
071//
072//    /**
073//     * This method is VMS specific and used by getProcEnvironment(). Parses VMS
074//     * symbols from <code>in</code> and adds them to <code>environment</code>.
075//     * <code>in</code> is expected to be the output of "SHOW SYMBOL/GLOBAL *".
076//     *
077//     * @param environment the current environment
078//     * @param in the reader from the process to determine VMS env variables
079//     * @return the updated environment
080//     * @throws IOException operation failed
081//     */
082//    private Map<String, String> addVMSenvironmentVariables(final Map<String, String> environment,
083//            final BufferedReader in) throws IOException {
084//        String line;
085//        while ((line = in.readLine()) != null) {
086//            final String SEP = "=="; // global symbol separator
087//            final int sepidx = line.indexOf(SEP);
088//            if (sepidx > 0) {
089//                final String name = line.substring(0, sepidx).trim();
090//                String value = line.substring(sepidx+SEP.length()).trim();
091//                value = value.substring(1,value.length()-1); // drop enclosing quotes
092//                environment.put(name,value);
093//            }
094//        }
095//        return environment;
096//    }
097}