org.eclipse.jgit.util.FS.lastModified()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中org.eclipse.jgit.util.FS.lastModified()方法的一些代码示例,展示了FS.lastModified()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FS.lastModified()方法的具体详情如下:
包路径:org.eclipse.jgit.util.FS
类名称:FS
方法名:lastModified

FS.lastModified介绍

[英]Get the last modified time of a file system object. If the OS/JRE support symbolic links, the modification time of the link is returned, rather than that of the link target.
[中]获取文件系统对象的上次修改时间。如果OS/JRE支持符号链接,则返回链接的修改时间,而不是链接目标的修改时间。

代码示例

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * 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);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * 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);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

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));
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

if (fName.length() != Constants.OBJECT_ID_STRING_LENGTH - 2)
  continue;
if (repo.getFS().lastModified(f) >= expireDate)
  continue;
try {

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

entry.setLastModified(fs.lastModified(f));
  return;
entry.setLastModified(fs.lastModified(f));

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

&& repo.getFS().lastModified(
      oldPack.getPackFile()) < packExpireDate) {
oldPack.close();

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * 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);
}

代码示例来源:origin: berlam/github-bucket

/**
 * 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);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

if (mergedFile != null) {
  dce.setLastModified(
      nonNullRepo().getFS().lastModified(mergedFile));
  dce.setLength((int) mergedFile.length());

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
 * 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);
}

代码示例来源:origin: berlam/github-bucket

/**
 * 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);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit.junit

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);

代码示例来源:origin: sonia.jgit/org.eclipse.jgit.junit

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);

代码示例来源:origin: com.madgag/org.eclipse.jgit.junit

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);

代码示例来源:origin: berlam/github-bucket

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));
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

&& repo.getFS().lastModified(
      oldPack.getPackFile()) < packExpireDate) {
oldPack.close();

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

entry.setLastModified(fs.lastModified(f));
  return;
entry.setLastModified(fs.lastModified(f));

代码示例来源:origin: berlam/github-bucket

&& repo.getFS().lastModified(
      oldPack.getPackFile()) < packExpireDate) {
oldPack.close();

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

if (mergedFile != null) {
  long len = mergedFile.length();
  dce.setLastModified(FS.DETECTED.lastModified(mergedFile));
  dce.setLength((int) len);
  InputStream is = new FileInputStream(mergedFile);

代码示例来源:origin: berlam/github-bucket

if (mergedFile != null) {
  dce.setLastModified(
      nonNullRepo().getFS().lastModified(mergedFile));
  dce.setLength((int) mergedFile.length());

相关文章