/** * Check if the path may have been modified since the snapshot was saved. * * @param path * the path the snapshot describes. * @return true if the path needs to be read again. */ public boolean isModified(File path) { long currLastModified; try { currLastModified = FS.DETECTED.lastModified(path); } catch (IOException e) { currLastModified = path.lastModified(); } return isModified(currLastModified); }
/** * Record a snapshot for a specific file path. * <p> * This method should be invoked before the file is accessed. * * @param path * the path to later remember. The path's current status * information is saved. * @return the snapshot. */ public static FileSnapshot save(File path) { long read = System.currentTimeMillis(); long modified; try { modified = FS.DETECTED.lastModified(path); } catch (IOException e) { modified = path.lastModified(); } return new FileSnapshot(read, modified); }
private void checkoutGitlink(String path, DirCacheEntry entry) throws IOException { File gitlinkDir = new File(repo.getWorkTree(), path); FileUtils.mkdirs(gitlinkDir, true); FS fs = repo.getFS(); entry.setLastModified(fs.lastModified(gitlinkDir)); }
if (fName.length() != Constants.OBJECT_ID_STRING_LENGTH - 2) continue; if (repo.getFS().lastModified(f) >= expireDate) continue; try {
entry.setLastModified(fs.lastModified(f)); return; entry.setLastModified(fs.lastModified(f));
&& repo.getFS().lastModified( oldPack.getPackFile()) < packExpireDate) { oldPack.close();
/** * Check if the path may have been modified since the snapshot was saved. * * @param path * the path the snapshot describes. * @return true if the path needs to be read again. */ public boolean isModified(File path) { long currLastModified; try { currLastModified = FS.DETECTED.lastModified(path); } catch (IOException e) { currLastModified = path.lastModified(); } return isModified(currLastModified); }
/** * Check if the path may have been modified since the snapshot was saved. * * @param path * the path the snapshot describes. * @return true if the path needs to be read again. */ public boolean isModified(File path) { long currLastModified; try { currLastModified = FS.DETECTED.lastModified(path); } catch (IOException e) { currLastModified = path.lastModified(); } return isModified(currLastModified); }
if (mergedFile != null) { dce.setLastModified( nonNullRepo().getFS().lastModified(mergedFile)); dce.setLength((int) mergedFile.length());
/** * Record a snapshot for a specific file path. * <p> * This method should be invoked before the file is accessed. * * @param path * the path to later remember. The path's current status * information is saved. * @return the snapshot. */ public static FileSnapshot save(File path) { long read = System.currentTimeMillis(); long modified; try { modified = FS.DETECTED.lastModified(path); } catch (IOException e) { modified = path.lastModified(); } return new FileSnapshot(read, modified); }
/** * Record a snapshot for a specific file path. * <p> * This method should be invoked before the file is accessed. * * @param path * the path to later remember. The path's current status * information is saved. * @return the snapshot. */ public static FileSnapshot save(File path) { long read = System.currentTimeMillis(); long modified; try { modified = FS.DETECTED.lastModified(path); } catch (IOException e) { modified = path.lastModified(); } return new FileSnapshot(read, modified); }
File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); try { long startTime = (lastFile == null) ? fs.lastModified(tmp) : fs .lastModified(lastFile); long actTime = fs.lastModified(tmp); while (actTime <= startTime) { Thread.sleep(sleepTime); actTime = fs.lastModified(tmp);
File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); try { long startTime = (lastFile == null) ? fs.lastModified(tmp) : fs .lastModified(lastFile); long actTime = fs.lastModified(tmp); while (actTime <= startTime) { Thread.sleep(sleepTime); FileOutputStream fos = new FileOutputStream(tmp); fos.close(); actTime = fs.lastModified(tmp);
File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null); try { long startTime = (lastFile == null) ? fs.lastModified(tmp) : fs .lastModified(lastFile); long actTime = fs.lastModified(tmp); while (actTime <= startTime) { Thread.sleep(sleepTime); sleepTime *= 5; fs.setLastModified(tmp, System.currentTimeMillis()); actTime = fs.lastModified(tmp);
private void checkoutGitlink(String path, DirCacheEntry entry) throws IOException { File gitlinkDir = new File(repo.getWorkTree(), path); FileUtils.mkdirs(gitlinkDir, true); FS fs = repo.getFS(); entry.setLastModified(fs.lastModified(gitlinkDir)); }
&& repo.getFS().lastModified( oldPack.getPackFile()) < packExpireDate) { oldPack.close();
entry.setLastModified(fs.lastModified(f)); return; entry.setLastModified(fs.lastModified(f));
&& repo.getFS().lastModified( oldPack.getPackFile()) < packExpireDate) { oldPack.close();
if (mergedFile != null) { long len = mergedFile.length(); dce.setLastModified(FS.DETECTED.lastModified(mergedFile)); dce.setLength((int) len); InputStream is = new FileInputStream(mergedFile);
if (mergedFile != null) { dce.setLastModified( nonNullRepo().getFS().lastModified(mergedFile)); dce.setLength((int) mergedFile.length());