See {@link #acquire(FilePath)}

@param quick
If true, indicates that the acquired workspace will be returned quickly.
This makes other calls to {@link #allocate(FilePath)} to wait for the release of this workspace.
490908
public synchronized Lease acquire(@Nonnull FilePath p, boolean quick) throws InterruptedException {
        return acquire(p,quick,new Object());
    }
1229604
def copy_file(self, filepath):
        
        copy_file = False
        try:
            copy_file = self.data[filepath]['copy']
        except KeyError:
            return False
        return copy_file
181318
public static FilePath createAndGetTempDir(final FilePath ws) throws IOException, InterruptedException {
        // The token that combines the project name and unique number to create unique workspace directory.
        String workspaceList = System.getProperty("hudson.slaves.WorkspaceList");
        return ws.act(new MasterToSlaveCallable<FilePath, IOException>() {
            @Override
            public FilePath call() {
                final FilePath tempDir = ws.sibling(ws.getName() + Objects.toString(workspaceList, "@") + "tmp").child("artifactory");
                File tempDirFile = new File(tempDir.getRemote());
                tempDirFile.mkdirs();
                tempDirFile.deleteOnExit();
                return tempDir;
            }
        });
    }
1347593
private void handleAnalyzeFromFile(String filePath) throws IOException {
        try (BufferedReader in = new BufferedReader(UTF8.fileReader(filePath))) {
            while (true) {
                String s = in.readLine();
                if (s == null) {
                    break;
                }
                project.addFile(s);
            }
        }
    }
910767
public static void deleteFilePath(FilePath workspace, String path) throws IOException {
        if (StringUtils.isNotBlank(path)) {
            try {
                FilePath propertiesFile = new FilePath(workspace, path);
                propertiesFile.delete();
            } catch (Exception e) {
                throw new IOException("Could not delete temp file: " + path);
            }
        }
    }
114000
@Nullable
  public static Properties loadPropertiesFromFile(String filePath) {
    try (FileInputStream fileInputStream = new FileInputStream(filePath)) {
      return loadProperties(fileInputStream);
    } catch (FileNotFoundException e) {
      return null;
    } catch (IOException e) {
      LOG.warn("Failed to close property input stream from {}: {}", filePath, e.toString());
      return null;
    }
  }
877563
private boolean quicklyPass(final RequestPath requestPath) {
        for (IgnoredPath p : ignoredPaths) {
            if (p.hit(requestPath)) {
                return true;
            }
        }
        return false;
    }
448144
public void setAcquireRetryDelay(long acquireRetryDelay, TimeUnit timeUnit) {
		this.acquireRetryDelayInMs = TimeUnit.MILLISECONDS.convert(acquireRetryDelay, timeUnit);
	}
389575
public synchronized void addFile(String filename, String filePath) {
        // fix this to check if duplicate name exists.
        int fileIndex = fileNameList.indexOf(filename);
        if (fileIndex == -1) {
            fileNameList.add(filename);
            filePathList.add(filePath);
        }
    }
1228328
public static File getFileFromClasspath(final String filePath) throws FileNotFoundException {
        try {
            URL fileURL = FileUtils.class.getClassLoader().getResource(filePath);
            if (fileURL == null) {
                throw new FileNotFoundException("File [" + filePath + "] could not be found in classpath");
            }
            return new File(fileURL.toURI());
        } catch (URISyntaxException e) {
            throw new FileNotFoundException("File [" + filePath + "] could not be found: " + e.getMessage());
        }
    }
483324
@Override
    public FileStore getFileStore(final Path path) throws IOException {
        final FileStore fileStore = path.getFileSystem().getFileStores().iterator().next();
        return fileStore;
    }
362364
public static String getFileContent(String filePath, long offset, int length) throws Exception {
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = getFileInputStream(filePath);
            return getFileContent(fileInputStream, offset, length);
        } finally {
            closeFileStream(fileInputStream, filePath);
        }
    }
1252101
public DirectoryEntry lookUp(
      File workingDirectory, JimfsPath path, Set<? super LinkOption> options) throws IOException {
    checkNotNull(path);
    checkNotNull(options);

    DirectoryEntry result = lookUp(workingDirectory, path, options, 0);
    if (result == null) {
      // an intermediate file in the path did not exist or was not a directory
      throw new NoSuchFileException(path.toString());
    }
    return result;
  }
929135
private static void loadFile(String filePath) {
        final Path path = FileSystems.getDefault().getPath(filePath);

        try {
            data.clear();
            data.load(Files.newBufferedReader(path));
        } catch(IOException e) {
            LOG.warn("Exception while loading " + path.toString(), e);
        }
    }
1141263
void fileReadCheck(String filePath) {
        File potentialFile = new File(filePath);
        String canonicalPath;
        try {
            canonicalPath = potentialFile.getCanonicalPath();
        } catch (IOException e) {
            error("Error getting canonical path", e);
            throw getException(filePath);
        }

        if (forbiddenReadFiles.stream().anyMatch(canonicalPath::startsWith)) {
            throw getException(filePath);
        }
    }
388512
public boolean newUpload(String filePath) {
        WebLocator uploadButton = new WebLocator(this).setTag("span").setClasses("fileupload-new").setElPathSuffix("icon-folder-open", "count(.//i[@class='icon-folder-open']) > 0");
        return upload(uploadButton, filePath);
    }
245142
protected String checkWorkingFolderInPath( String filePath ) {
        if (filePath.contains(HMConstants.WORKINGFOLDER)) {
            return null;
        }
        return filePath;
    }