Acquires the staleFile for this execution

@return the staleFile (used to define where) for this execution
966830
protected final File getStaleFile() {
        final String staleFileName = "."
                + (getExecution() == null ? "nonExecutionJaxb" : getExecution().getExecutionId())
                + "-" + getStaleFileName();
        return new File(staleFileDirectory, staleFileName);
    }
370936
public File getLocalFile() {
        if (this.localFile == null) {
            ChunkUtil util = new ChunkUtil();
            String contentId = contentItem.getContentId();
            if (util.isChunkManifest(contentId)) {
                contentId = util.preChunkedContentId(contentId);
            }

            if (createSpaceDir) {
                File spaceDir = new File(contentDir, contentItem.getSpaceId());
                logger.debug("spaceDir.absolutePath={}", spaceDir.getAbsolutePath());
                this.localFile = new File(spaceDir, contentId);
            } else {
                this.localFile = new File(contentDir, contentId);
            }
        }

        logger.debug("localFile.absolutePath={}", this.localFile.getAbsolutePath());

        return this.localFile;
    }
1224775
public T acquire() {
        T t = pool.poll();
        if (t == null) {
            t = create();
            ++count;
        }
        ++requests;
        // log();
        return t;
    }
697898
public File getNextFile() throws IOException {
		synchronized(this) {
			// Loop trying to get the file because files may be removed during the loop
			while(true) {
				if(filesDone) return null;

				// Initialize the stacks, if needed
				if(currentDirectories==null) {
					if(startPath.length()==0) {
						// Starting at root will include the starting directory itself
						(currentDirectories=new Stack<>()).push("");
						(currentLists=new Stack<>()).push(getFilesystemRoots());
					} else {
						if(isFilesystemRoot(startPath)) {
							// Starting from a root, has no parent
							(currentDirectories=new Stack<>()).push("");
							(currentLists=new Stack<>()).push(new String[] {startPath});
						} else {
							// Starting at non root will include the starting directory itself
							File startPathFile = new File(startPath);
							String parent = startPathFile.getParent();
							String name = startPathFile.getName();
							(currentDirectories=new Stack<>()).push(parent);
							(currentLists=new Stack<>()).push(new String[] {name});
						}
					}
					(currentIndexes=new Stack<>()).push(0);
				}
				String currentDirectory;
				String[] currentList=null;
				int currentIndex=-1;
				try {
					currentDirectory=currentDirectories.peek();
					currentList=currentLists.peek();
					currentIndex=currentIndexes.peek();

					// Undo the stack as far as needed
					while(currentDirectory!=null && currentIndex>=currentList.length) {
						currentDirectories.pop();
						currentLists.pop();
						currentIndexes.pop();
						String oldCurrentDirectory = currentDirectory;
						currentDirectory=currentDirectories.peek();
						currentList=currentLists.peek();
						currentIndex=currentIndexes.peek();
						if(!isPreorder) return new File(oldCurrentDirectory); // This is performed last because the EmptyStackException caused by peek indicates end of traversal
					}
				} catch(EmptyStackException err) {
					currentDirectory=null;
				}
				if(currentDirectory==null) {
					filesDone=true;
					return null;
				} else {
					// Get the current filename
					final String filename;
					if(currentDirectory.length()==0) filename=currentList[currentIndex];
					else if(currentDirectory.endsWith(File.separator)) filename=currentDirectory+currentList[currentIndex];
					else filename=currentDirectory+File.separatorChar+currentList[currentIndex];

					// Increment index to point to the next file
					currentIndexes.pop();
					currentIndexes.push(currentIndex+1);

					try {
						final File file=new File(filename);
						if(file.isDirectory()) {
							// Directories
							final String filenamePlusSlash;
							if(filename.endsWith(File.separator)) filenamePlusSlash = filename;
							else filenamePlusSlash = filename+File.separatorChar;

							final boolean includeDirectory;
							final boolean recurse;
							// If the settings for the directory indicate include
							if(isIncluded(filename)) {
								// Directory is included, optimized recurse follows
								includeDirectory = true;
								FilesystemIteratorRule rule = rules.get(filenamePlusSlash);
								if(rule==null) {
									recurse = true;
								} else {
									if(rule.isIncluded(filenamePlusSlash)) {
										recurse = true;
									} else {
										// This is the shortcut to not list directory when flagged as "/proc/"-style skip and
										// there are no overriding children
										recurse = hasIncludedChild(filenamePlusSlash);
									}
								}
							} else {
								// Force include if there are any backup-enabled settings that are a child of this
								if(hasIncludedChild(filenamePlusSlash)) {
									includeDirectory = true;
									recurse = true;
								} else {
									includeDirectory = false;
									recurse = false;
								}
							}
							// Push on stacks for next level
							if(includeDirectory) {
								String[] list;
								if(recurse) {
									// Skip anything that is not canonical, this avoids symbolic link targets
									if(file.getCanonicalPath().equals(filename)) {
										list = file.list();
										if(list==null) {
											list = AoArrays.EMPTY_STRING_ARRAY;
										} else if(isSorted && list.length>0) {
											Arrays.sort(list);
										}
									} else {
										//System.err.println("Skipping non-canonical directory listing: "+filename);
										list = AoArrays.EMPTY_STRING_ARRAY;
									}
								} else {
									list = AoArrays.EMPTY_STRING_ARRAY;
								}
								// No need to push onto the stack if the children are empty?
								if(list.length>0) {
									currentDirectories.push(filename);
									currentLists.push(list);
									currentIndexes.push(0);
									if(isPreorder) return file;
								} else {
									// If empty directory both preorder and postorder return directory immediately
									// and bypass using the stack.
									return file;
								}
							} else {
								if(recurse) throw new AssertionError("recurse=true and includeDirectory=false");
							}
						} else {
							// Non-directories
							if(isIncluded(filename)) return file;
						}
					} catch(FileNotFoundException err) {
						// Normal if the file was deleted while accessing
					}
				}
			}
		}
	}
1093186
public static FileUtilLimited getInstance() {

    if (instance == null) {
      synchronized (FileUtilLimitedImpl.class) {
        if (instance == null) {
          FileUtilLimitedImpl util = new FileUtilLimitedImpl();
          util.initialize();
          instance = util;
        }
      }
    }
    return instance;
  }
1030569
def acquire(self):
        
        start_time = time.time()
        while True:
            try:
                self.fd = os.open(self.lockfile,
                                  os.O_CREAT | os.O_EXCL | os.O_RDWR)
                break
            except (OSError,) as e:
                if e.errno != errno.EEXIST:
                    raise
                if (time.time() - start_time) >= self.timeout:
                    raise FileLockException("%s: Timeout occured." %
                                            self.lockfile)
                time.sleep(self.delay)

        self.is_locked = True
1159259
public File getBuildDir() {
        // we use the null check variant so that people can write true unit tests with a mock ItemParent
        // and without a JenkinsRule. Such tests are of limited utility as there is a high risk of hitting
        // some code that needs the singleton, but for persistence migration test cases it makes sense to permit
        Jenkins j = Jenkins.getInstanceOrNull();
        if (j == null) {
            return new File(getRootDir(), "builds");
        }
        return j.getBuildDirFor(this);
    }
518109
public final LWMConfig getFilestore() {

        String thisMethodName = "getFilestore";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
            SibTr.exit(tc, thisMethodName, _fs);
        }

        return _fs;
    }
635536
public long getUsed() throws IOException{
    long used = 0;
    FileStatus[] files = listStatus(new Path("/"));
    for(FileStatus file:files){
      used += file.getLen();
    }
    return used;
  }
648058
public @CheckForNull Queue.Executable getCurrentExecutable() {
        lock.readLock().lock();
        try {
            return executable;
        } finally {
            lock.readLock().unlock();
        }
    }
781851
protected Content getNextFile() throws IOException {
        JarEntry entry;
        if ((entry = jis.getNextJarEntry()) != null) {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            byte[] data = new byte[BUFFER];
            int size;
            while ((size = jis.read(data, 0, data.length)) != -1) {
                bos.write(data, 0, size);
            }
            Content file = new Content(entry.getName(), bos.toByteArray());
            bos.close();
            return file;
        }
        return null;
    }
1309628
public File getPropertiesFile() {
        final String path = line.getOptionValue(ARGUMENT.PROP);
        if (path != null) {
            return new File(path);
        }
        return null;
    }
86678
public T acquire() {
    if (closed) {
      throw new IllegalStateException("pool closed");
    }

    T reference = pool.poll();
    if (reference == null) {
      reference = factory.createReference(this);
    }
    reference.acquire();
    return reference;
  }
240487
private ImmutableSet<File> findGeneratedFilesInDirectory(File directory) throws IOException {
    if (directory == null || !directory.isDirectory())
      return ImmutableSet.of();
    List<File> sourceFilesInDirectory = getFiles(directory, "**/*.java", null);
    sourceFilesInDirectory.addAll(getFiles(directory, "**/*.scala", null));
    return ImmutableSet.copyOf(sourceFilesInDirectory);
  }
140386
private void getNextFileToRead() throws IOException {
    if (this.currentFile != null && this.currentFileItr != null) {
      closeCurrentFile();
      incrementBytesReadCounter();
    }

    while (!this.hasNext && !this.filesToPull.isEmpty()) {
      this.currentFile = this.filesToPull.remove(0);
      this.currentFileItr = downloadFile(this.currentFile);
      this.hasNext = this.currentFileItr == null ? false : this.currentFileItr.hasNext();
      LOG.info("Will start downloading file: " + this.currentFile);
    }
  }
641681
public CmsFile getFile() {

        if ((m_file == null) && !isFolder()) {
            try {
                m_file = m_cms.readFile(this);
            } catch (CmsException e) {
                // this should not happen since we are updating from a resource object
            }
        }
        return m_file;
    }
5723
private void getNextFile(final InputStream is) throws IOException {
    if (is instanceof  java.util.zip.ZipInputStream) {
      ZipEntry ze = ((ZipInputStream) is).getNextEntry();
      while (ze != null && ze.isDirectory())
        ze = ((ZipInputStream) is).getNextEntry();
    }
  }