当前位置: 首页>>代码示例>>Java>>正文


Java IFileInfo.getLastModified方法代码示例

本文整理汇总了Java中org.eclipse.core.filesystem.IFileInfo.getLastModified方法的典型用法代码示例。如果您正苦于以下问题:Java IFileInfo.getLastModified方法的具体用法?Java IFileInfo.getLastModified怎么用?Java IFileInfo.getLastModified使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.filesystem.IFileInfo的用法示例。


在下文中一共展示了IFileInfo.getLastModified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.eclipse.core.filesystem.IFileInfo; //导入方法依赖的package包/类
public void create(IFileStore fileStore, IProgressMonitor monitor) throws CoreException {
  IFileInfo info = fileStore.fetchInfo();
  fFileStore = fileStore;
  if (fLocation == null) fLocation = URIUtil.toPath(fileStore.toURI());

  initializeFileBufferContent(monitor);
  if (info.exists()) fSynchronizationStamp = info.getLastModified();

  addFileBufferContentListeners();
}
 
开发者ID:eclipse,项目名称:che,代码行数:11,代码来源:FileStoreFileBuffer.java

示例2: addDirectories

import org.eclipse.core.filesystem.IFileInfo; //导入方法依赖的package包/类
/**
 * Creates the directory entries for the given path and writes it to the
 * current archive.
 *
 * @param resource
 *            the resource for which the parent directories are to be added
 * @param destinationPath
 *            the path to add
 *
 * @throws IOException
 *             if an I/O error has occurred
 * @throws CoreException
 *             if accessing the resource failes
 */
protected void addDirectories(IResource resource, IPath destinationPath) throws IOException, CoreException {
	IContainer parent= null;
	String path= destinationPath.toString().replace(File.separatorChar, '/');
	int lastSlash= path.lastIndexOf('/');
	List<JarEntry> directories= new ArrayList<JarEntry>(2);
	while (lastSlash != -1) {
		path= path.substring(0, lastSlash + 1);
		if (!fDirectories.add(path))
			break;

		parent= resource.getParent();
		long timeStamp= System.currentTimeMillis();
		URI location= parent.getLocationURI();
		if (location != null) {
			IFileInfo info= EFS.getStore(location).fetchInfo();
			if (info.exists())
				timeStamp= info.getLastModified();
		}

		JarEntry newEntry= new JarEntry(path);
		newEntry.setMethod(ZipEntry.STORED);
		newEntry.setSize(0);
		newEntry.setCrc(0);
		newEntry.setTime(timeStamp);
		directories.add(newEntry);

		lastSlash= path.lastIndexOf('/', lastSlash - 1);
	}

	for (int i= directories.size() - 1; i >= 0; --i) {
		fJarOutputStream.putNextEntry(directories.get(i));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:48,代码来源:JarWriter3.java

示例3: addFile

import org.eclipse.core.filesystem.IFileInfo; //导入方法依赖的package包/类
/**
 * Creates a new JarEntry with the passed path and contents, and writes it
 * to the current archive.
 *
 * @param	resource			the file to write
 * @param	path				the path inside the archive
 *
    * @throws	IOException			if an I/O error has occurred
 * @throws	CoreException 		if the resource can-t be accessed
 */
protected void addFile(IFile resource, IPath path) throws IOException, CoreException {
	JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/'));
	byte[] readBuffer= new byte[4096];

	if (fJarPackage.isCompressed())
		newEntry.setMethod(ZipEntry.DEFLATED);
		// Entry is filled automatically.
	else {
		newEntry.setMethod(ZipEntry.STORED);
		JarPackagerUtil.calculateCrcAndSize(newEntry, resource.getContents(false), readBuffer);
	}

	long lastModified= System.currentTimeMillis();
	URI locationURI= resource.getLocationURI();
	if (locationURI != null) {
		IFileInfo info= EFS.getStore(locationURI).fetchInfo();
		if (info.exists())
			lastModified= info.getLastModified();
	}

	// Set modification time
	newEntry.setTime(lastModified);

	InputStream contentStream = resource.getContents(false);

	addEntry(newEntry, contentStream);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:38,代码来源:JarWriter3.java

示例4: getModificationStamp

import org.eclipse.core.filesystem.IFileInfo; //导入方法依赖的package包/类
public long getModificationStamp() {
  IFileInfo info = fFileStore.fetchInfo();
  return info.exists() ? info.getLastModified() : IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:AbstractFileBuffer.java


注:本文中的org.eclipse.core.filesystem.IFileInfo.getLastModified方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。