Get the default filesystem URI from a configuration.
@param conf the configuration to access
@return the uri of the default filesystem
322264
public static URI getDefaultUri(Configuration conf) {
    return URI.create(fixName(conf.get(FS_DEFAULT_NAME_KEY, "file:///")));
  }
876811
public static void setDefaultUri(Configuration conf, String uri) {
    setDefaultUri(conf, URI.create(fixName(uri)));
  }
694401
@Override
  public CloudStorageFileSystem getFileSystem(URI uri) {
    initStorage();
    return newFileSystem(uri, Collections.<String, Object>emptyMap());
  }
5166
@Override
    public void init(Configuration conf) {
        String rootName = conf.get(ConfigConstants.CONF_DELIMITED_ROOT_NAME, 
                DEFAULT_ROOT_NAME);
        rootStart = '<' + rootName + '>';
        rootEnd = "</" + rootName + '>';
        
    }
1316330
def get_default_config(self):
        
        config = super(VMSFSCollector, self).get_default_config()
        config.update({
            'path':     'vmsfs'
        })
        return config
1242381
def get_default_config_file_path(init_filename=None):
    """"""
    prm_dir = get_package_prm_dir()
    if not init_filename:
        init_filename = DEFAULT_FILENAME
    src = os.path.join(prm_dir, init_filename)
    return src
619590
private static Configuration getDefault(){
        Configuration config = new Configuration();
        config.addHandler(new ConsoleAuditHandler());
        config.setMetaData(new DummyMetaData());
        config.setLayout(new SimpleLayout());
        config.addProperty("log.file.location", "user.dir");
        return config;
    }
872493
protected static URL findConfigUrlInDirectory(File directory, String configName) {
        if (directory.isDirectory()) {
            File cfile = new File(directory, configName);
            if (cfile.isFile()) {
                try {
                    return cfile.toURI().toURL();
                } catch (MalformedURLException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        return null;
    }
484041
public static String resolveUriPrefix(Config config, SharedRestClientKey key) throws URISyntaxException, NotConfiguredException {

    List<String> connectionPrefixes = parseConnectionPrefixes(config, key);
    Preconditions.checkArgument(connectionPrefixes.size() > 0, "No uris found for service " + key.serviceName);

    return connectionPrefixes.get(new Random().nextInt(connectionPrefixes.size()));
  }
1252483
public void initialize(URI name, Configuration conf) throws IOException {
    // if an underlying fs has not already been specified,
    // create and initialize one
    if (this.fs == null) {
      Class<?> clazz = conf.getClass("fs.apitrace.underlyingfs.impl",
                                     DistributedFileSystem.class);
      if (clazz == null) {
        throw new IOException("No FileSystem for fs.apitrace.underlyingfs.impl.");
      }

      this.fs = (FileSystem)ReflectionUtils.newInstance(clazz, null);
      super.initialize(name, conf);
    }

    // trace conf options
    for (String opt : traceConfOpts) {
      APITrace.CallEvent ce = new APITrace.CallEvent();
      ce.logCall(APITrace.COMMENT_msg, null,
                 new Object[] {opt, conf.get(opt, "")});
    }
  }
1125856
public static String[] getListOfDataDirs(Configuration conf) {
    String[] configFilePath = conf.getStrings("dfs.datadir.confpath");
    String[] dataDirs = null;
    if(configFilePath != null && (configFilePath.length != 0)) {
      try {
        DataDirFileReader reader = new DataDirFileReader(configFilePath[0]);
        dataDirs = reader.getArrayOfCurrentDataDirectories();
        if(dataDirs == null) {
          LOG.warn("File is empty, using dfs.data.dir directories");
        }
      } catch (Exception e) {
        LOG.warn("Could not read file, using directories from dfs.data.dir" +
                                                         " Exception: ", e);
      }
    } else {
      LOG.warn("No dfs.datadir.confpath not defined, now using default " +
                                                              "directories");
    }
    if(dataDirs == null) {
      dataDirs = conf.getStrings("dfs.data.dir");
    }
    return dataDirs;

  }
436690
static FileSystem getFs(Configuration conf, Path p) {
    try {
      return p.getFileSystem(conf);
    } catch (Exception e) {
      // if a single namenode is down, log it and ignore. Continue to
      // fix other namenodes.
      LOG.warn("getFs: Unable to contact filesystem: " + p + " ignoring.... " +
               e);
      e.printStackTrace();
      return null;
    }
  }
44245
protected String getDirectory() {
        //get the default filepath of the permanet storage file
        String directory = storageConfiguration.getDirectory();

        if(directory == null || directory.isEmpty()) {
            directory = System.getProperty("java.io.tmpdir"); //write them to the tmp directory
        }

        return directory;
    }
1368655
public static URL[] getLibJars(Configuration conf) throws IOException {
    String jars = conf.get("tmpjars");
    if(jars==null) {
      return null;
    }
    String[] files = jars.split(",");
    URL[] cp = new URL[files.length];
    for (int i=0;i<cp.length;i++) {
      Path tmp = new Path(files[i]);
      cp[i] = FileSystem.getLocal(conf).pathToFile(tmp).toURI().toURL();
    }
    return cp;
  }
395813
function Config(conf){
  try{
    if(typeof conf === 'string'){
      this.confPath = conf;
      conf = ini.parse(fs.readFileSync(conf, 'utf8'));
    }
  }catch(e){
    conf = {}
  }
  this.conf= conf || {};
}
158190
public static UserGroupInformation readFrom(Configuration conf
      ) throws IOException {
    try {
      return UnixUserGroupInformation.readFromConf(conf,
        UnixUserGroupInformation.UGI_PROPERTY_NAME);
    } catch (LoginException e) {
      throw (IOException)new IOException().initCause(e);
    }
  }
535610
public static String getDomainFromResolverConf(final String file) {
    try (final InputStream in = new FileInputStream(file)) {
      final InputStreamReader isr = new InputStreamReader(in);
      try (final BufferedReader br = new BufferedReader(isr)) {
        String line;
        while ((line = br.readLine()) != null) {
          if (line.startsWith("domain")) {
            final StringTokenizer st = new StringTokenizer(line);
            st.nextToken(); /* skip "domain" */
            if (!st.hasMoreTokens()) {
              continue;
            }
            return st.nextToken();
          }
        }
      }
    } catch (FileNotFoundException e) {
      log.warn("Resolver config file not found", e);
    } catch (IOException e) {
      log.warn("Error reading config file", e);
    }
    return "";
  }