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


Java EFS.SET_LAST_MODIFIED属性代码示例

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


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

示例1: putInfo

void putInfo(IPath path, IFileInfo info, int options) throws CoreException {
  CommonNode node = find(path);
  if (node == null) {
    throw newCoreException("The store does not exist: " + path, null); //$NON-NLS-1$
  } else {
    if ((options & EFS.SET_ATTRIBUTES) != 0) {
      copyAttribute(info, node.info, EFS.ATTRIBUTE_ARCHIVE);
      copyAttribute(info, node.info, EFS.ATTRIBUTE_EXECUTABLE);
      copyAttribute(info, node.info, EFS.ATTRIBUTE_HIDDEN);
      copyAttribute(info, node.info, EFS.ATTRIBUTE_LINK_TARGET);
      copyAttribute(info, node.info, EFS.ATTRIBUTE_READ_ONLY);
    }
    if ((options & EFS.SET_LAST_MODIFIED) != 0) {
      node.info.setLastModified(info.getLastModified());
    }
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:17,代码来源:ChromiumScriptStorage.java

示例2: putInfo

public void putInfo(IFileInfo info, int options, IProgressMonitor monitor) throws CoreException {
  boolean success = true;
  if ((options & EFS.SET_ATTRIBUTES) != 0) {
    //			if (LocalFileNativesManager.isUsingNatives())
    //				success &= LocalFileNativesManager.putFileInfo(filePath, info, options);
  }
  // native does not currently set last modified
  if ((options & EFS.SET_LAST_MODIFIED) != 0)
    success &= file.setLastModified(info.getLastModified());
  if (!success && !file.exists())
    Policy.error(EFS.ERROR_NOT_EXISTS, NLS.bind(Messages.fileNotFound, filePath));
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:LocalFile.java

示例3: transferAttributes

private void transferAttributes(IFileInfo sourceInfo, IFileStore destination)
    throws CoreException {
  int options = EFS.SET_ATTRIBUTES | EFS.SET_LAST_MODIFIED;
  destination.putInfo(sourceInfo, options, null);
}
 
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:FileStore.java

示例4: putInfo

public final synchronized void putInfo(IPath path, IFileInfo info, int options, IProgressMonitor monitor)
		throws CoreException
{
	monitor = Policy.monitorFor(monitor);
	monitor.beginTask(
			MessageFormat.format(Messages.BaseConnectionFileManager_putting_changes, path.toPortableString()), 5);
	try
	{
		ProgressMonitorInterrupter.setCurrentThreadInterruptDelegate(interruptDelegate);
		testOrConnect(monitor);
		if ((options & EFS.SET_LAST_MODIFIED) != 0)
		{
			setModificationTime(basePath.append(path), info.getLastModified(), Policy.subMonitorFor(monitor, 1));
			setLastOperationTime();
		}
		if ((options & EFS.SET_ATTRIBUTES) != 0 && (options & IExtendedFileInfo.SET_PERMISSIONS) == 0)
		{
			ExtendedFileInfo fileInfo = fetchAndCacheFileInfo(path, Policy.subMonitorFor(monitor, 1));
			if (fileInfo.exists())
			{
				long permissions = fileInfo.getPermissions();
				if (!info.getAttribute(EFS.ATTRIBUTE_READ_ONLY))
				{
					permissions |= IExtendedFileInfo.PERMISSION_OWNER_WRITE;
				}
				else
				{
					permissions &= ~IExtendedFileInfo.PERMISSION_OWNER_WRITE;
				}
				if (info.getAttribute(EFS.ATTRIBUTE_EXECUTABLE))
				{
					permissions |= IExtendedFileInfo.PERMISSION_OWNER_EXECUTE;
				}
				else
				{
					permissions &= ~IExtendedFileInfo.PERMISSION_OWNER_EXECUTE;
				}
				changeFilePermissions(basePath.append(path), permissions, Policy.subMonitorFor(monitor, 1));
			}
			setLastOperationTime();
		}
		if (info instanceof IExtendedFileInfo)
		{
			IExtendedFileInfo extInfo = (IExtendedFileInfo) info;
			if ((options & IExtendedFileInfo.SET_PERMISSIONS) != 0)
			{
				changeFilePermissions(basePath.append(path), extInfo.getPermissions(),
						Policy.subMonitorFor(monitor, 1));
			}
			if ((options & IExtendedFileInfo.SET_GROUP) != 0)
			{
				changeFileGroup(basePath.append(path), extInfo.getGroup(), Policy.subMonitorFor(monitor, 1));
			}
			setLastOperationTime();
		}
	}
	catch (FileNotFoundException e)
	{
		setLastOperationTime();
		throw new CoreException(new Status(IStatus.ERROR, CoreIOPlugin.PLUGIN_ID,
				Messages.BaseConnectionFileManager_no_such_file, initFileNotFoundException(path, e.getCause())));
	}
	finally
	{
		ProgressMonitorInterrupter.setCurrentThreadInterruptDelegate(null);
		clearCache(path);
		monitor.done();
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:69,代码来源:BaseConnectionFileManager.java


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