Fetch single job file based on its URI,
return null requested URI not existed
@param uri The relative Path to the target job configuration.
@return
19938
@Override
  public synchronized JobSpec getJobSpec(URI uri)
      throws JobSpecNotFoundException {
    try {
      Path targetJobSpecFullPath = getPathForURI(this.jobConfDirPath, uri);
      return this.converter.apply(loader.loadPullFile(targetJobSpecFullPath, this.sysConfig, shouldLoadGlobalConf()));
    } catch (FileNotFoundException e) {
      throw new JobSpecNotFoundException(uri);
    } catch (IOException e) {
      throw new RuntimeException("IO exception thrown on loading single job configuration file:" + e.getMessage());
    }
  }
907219
public static File getFile(Context context, Uri uri) {
        if (uri != null) {
            String path = getPath(context, uri);
            if (path != null && isLocal(path)) {
                return new File(path);
            }
        }
        return null;
    }
1118964
public JimfsPath toPath(URI uri) {
    fileStore.state().checkOpen();
    return pathService.fromUri(uri);
  }
931973
@Nullable
  public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
    String result = null;
    if (isLocalContentUri(srcUri)) {
      Cursor cursor = null;
      try {
        cursor = contentResolver.query(srcUri, null, null, null, null);
        if (cursor != null && cursor.moveToFirst()) {
          int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
          if (idx != -1) {
            result = cursor.getString(idx);
          }
        }
      } finally {
        if (cursor != null) {
          cursor.close();
        }
      }
    } else if (isLocalFileUri(srcUri)) {
      result = srcUri.getPath();
    }
    return result;
  }
1156175
public Server getServerByUri(final String uri) {
        for (Server server : SERVERS) {
            if (server.getManagementUri().equals(uri)) {
                return server;
            }
        }

        return null;
    }
492482
public <T> T get(URI uri, Class<T> classType) {
        HttpConnection connection = Http.GET(uri);
        InputStream response = executeToInputStream(connection);
        try {
            return getResponse(response, classType, getGson());
        } finally {
            close(response);
        }
    }
294542
public static Process openUri(final String uri)
        {
        if (SystemUtils.IS_OS_MAC_OSX)
            {
            return openSiteMac(uri);
            }
        else if (SystemUtils.IS_OS_WINDOWS)
            {
            return openSiteWindows(uri);
            }
        
        return null;
        }
906547
@Trivial
    private static URI getURI(final File file) {
        return AccessController.doPrivileged( new PrivilegedAction<URI>() {
            @Override
            public URI run() {
                return file.toURI();
            }
        } );
    }
1284024
def get_job(id_or_uri, opts = {})
      data, _status_code, _headers = get_job_with_http_info(id_or_uri, opts)
      return data
    end
556454
public static RedisURI create(String uri) {
        LettuceAssert.notEmpty(uri, "URI must not be empty");
        return create(URI.create(uri));
    }
1050407
public InputStream get(URI uri) {
        HttpConnection httpConnection = Http.GET(uri);
        return executeToInputStream(httpConnection);
    }
928848
public static VirtualFile getChild(URI uri) {
        String path = uri.getPath();
        if(path == null) {
            path = uri.getSchemeSpecificPart();
        }
        return getChild(path);
    }
1095307
@Override
    public InputStream getDocument(URI documentUri) throws DocumentException {

        if (!documentExists(documentUri)) {
            return null;
        }

        File dir = new File(this.getDocumentInternalUri(documentUri));
        for (File file : dir.listFiles()) {
            if (file.getName().matches("^index\\..*")) {
                InputStream result = null;
                try {
                    result = new FileInputStream(file);
                } catch (IOException e) {
                    throw new DocumentException(e);
                }
                return result;
            }
        }
        return null;
    }
475606
public String findString(String uri) throws IOException {
        String fullUri = path + uri;

        URL resource = getResource(fullUri);
        if (resource == null) {
            throw new IOException("Could not find a resource in : " + fullUri);
        }

        return readContents(resource);
    }
422057
protected Path getPathForURI(Path fsSpecStoreDirPath, URI uri, String version) {
    return PathUtils.addExtension(PathUtils.mergePaths(fsSpecStoreDirPath, new Path(uri)), version);
  }
918551
protected static CollectorConfiguration loadConfig(String uri, String type) {
        final CollectorConfiguration config = new CollectorConfiguration();

        if (type == null) {
            type = DEFAULT_TYPE;
        }

        uri += java.io.File.separator + type;

        File f = new File(uri);

        if (!f.isAbsolute()) {
            if (f.exists()) {
                uri = f.getAbsolutePath();
            } else if (System.getProperties().containsKey("jboss.server.config.dir")) {
                uri = System.getProperty("jboss.server.config.dir") + java.io.File.separatorChar + uri;
            } else {
                try {
                    URL url = Thread.currentThread().getContextClassLoader().getResource(uri);
                    if (url != null) {
                        uri = url.getPath();
                    } else {
                        log.severe("Failed to get absolute path for uri '" + uri + "'");
                    }
                } catch (Exception e) {
                    log.log(Level.SEVERE, "Failed to get absolute path for uri '" + uri + "'", e);
                    uri = null;
                }
            }
        }

        if (uri != null) {
            String[] uriParts = uri.split(Matcher.quoteReplacement(File.separator));
            int startIndex = 0;

            // Remove any file prefix
            if (uriParts[0].equals("file:")) {
                startIndex++;
            }

            try {
                Path path = getPath(startIndex, uriParts);

                Files.walkFileTree(path, new FileVisitor<Path>() {

                    @Override
                    public FileVisitResult postVisitDirectory(Path path, IOException exc) throws IOException {
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) throws IOException {
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException {
                        if (path.toString().endsWith(".json")) {
                            String json = new String(Files.readAllBytes(path));
                            CollectorConfiguration childConfig = mapper.readValue(json, CollectorConfiguration.class);
                            if (childConfig != null) {
                                config.merge(childConfig, false);
                            }
                        }
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult visitFileFailed(Path path, IOException exc) throws IOException {
                        return FileVisitResult.CONTINUE;
                    }

                });
            } catch (Throwable e) {
                log.log(Level.SEVERE, "Failed to load configuration", e);
            }
        }

        return config;
    }
199090
public String resolveRelativeUri(String uri) {
        // sometimes we get uri's massaged from File(String), so check for
        // a root directory separator char
        if (uri.startsWith("/") || uri.startsWith(File.separator)) {
            return uri;
        } else {
            return baseURI + uri;
        }
    }