• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FileInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.core.filesystem.provider.FileInfo的典型用法代码示例。如果您正苦于以下问题:Java FileInfo类的具体用法?Java FileInfo怎么用?Java FileInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



FileInfo类属于org.eclipse.core.filesystem.provider包,在下文中一共展示了FileInfo类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
/**
 * Get file info for this directory.
 */
/* Override */
public IFileInfo fetchInfo( int options, IProgressMonitor monitor )
   throws CoreException
{
   updateZXTM();
   
   FileInfo info = new FileInfo( name );
   
   if( zxtm == null ) {         
      info.setExists( false );
      info.setDirectory( true );
      info.setLength( EFS.NONE );
      info.setLastModified( EFS.NONE );
   } else {                
      info.setExists( true );
      info.setDirectory( true );
      info.setLength( EFS.NONE );
      info.setLastModified( EFS.NONE );
      info.setAttribute( EFS.ATTRIBUTE_READ_ONLY, false );
   }
      
   return info;
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:27,代码来源:RuleDirectoryFileStore.java


示例2: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
@Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
	FileInfo fileInfo = new FileInfo(getName());
	fileInfo.setExists(true);
	fileInfo.setAttribute(EFS.ATTRIBUTE_OWNER_WRITE, true);
	
	return fileInfo;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:9,代码来源:CouchDBFileStore.java


示例3: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) {
  //		if (LocalFileNativesManager.isUsingNatives()) {
  //			FileInfo info = LocalFileNativesManager.fetchFileInfo(filePath);
  //			//natives don't set the file name on all platforms
  //			if (info.getName().length() == 0) {
  //				String name = file.getName();
  //				//Bug 294429: make sure that substring baggage is removed
  //				info.setName(new String(name.toCharArray()));
  //			}
  //			return info;
  //		}
  // in-lined non-native implementation
  FileInfo info = new FileInfo(file.getName());
  final long lastModified = file.lastModified();
  if (lastModified <= 0) {
    // if the file doesn't exist, all other attributes should be default values
    info.setExists(false);
    return info;
  }
  info.setLastModified(lastModified);
  info.setExists(true);
  info.setLength(file.length());
  info.setDirectory(file.isDirectory());
  info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, file.exists() && !file.canWrite());
  info.setAttribute(EFS.ATTRIBUTE_HIDDEN, file.isHidden());
  return info;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:LocalFile.java


示例4: CommonNode

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
CommonNode(IPath path, FolderNode parent, boolean isDirectory) {
  this.path = path;
  this.parent = parent;
  this.info = new FileInfo(path.lastSegment());
  this.info.setDirectory(isDirectory);
  this.info.setExists(true);
  if (parent != null) {
    parent.add(this);
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:11,代码来源:ChromiumScriptStorage.java


示例5: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
IFileInfo fetchInfo(IPath path, int options) {
  CommonNode node = find(path);
  if (node == null) {
    FileInfo fileInfo = new FileInfo(path.lastSegment());
    fileInfo.setExists(false);
    return fileInfo;
  } else {
    return node.info;
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:11,代码来源:ChromiumScriptStorage.java


示例6: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
/** Returns the files info for a non-existent file */
/* Override */
public IFileInfo fetchInfo( int options, IProgressMonitor monitor )
   throws CoreException
{
   FileInfo info = new FileInfo( name );
   info.setExists( false );
   info.setDirectory( false );
   info.setLength( EFS.NONE );
   info.setLastModified( EFS.NONE );

   return info;
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:14,代码来源:EmptyFileStore.java


示例7: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
/** Return info about this rule, including if it currently exists or not */
/* Override */
public IFileInfo fetchInfo( int options, IProgressMonitor monitor )
   throws CoreException
{   
   FileInfo info = new FileInfo( ZXTMFileSystem.toOSName( ruleName ) + ZXTMFileSystem.TS_FILE_EXTENSION );
   
   updateRule();
   
   // If this rule does not exist return empty info
   if( rule == null || rule.getModelState() == State.DELETED ) {
      info.setExists( false );
      info.setDirectory( false );
      info.setLength( EFS.NONE );
      info.setLastModified( EFS.NONE );
      info.setAttribute( EFS.ATTRIBUTE_READ_ONLY, false );
   
   // Otherwise return the rules info
   } else {      
      info.setExists( true );
      info.setDirectory( false );
      if( rule.getTrafficScriptCode() != null ) {
         info.setLength( rule.getTrafficScriptCode().length() );
      } else {
         info.setLength( 0 );
      }
      info.setLastModified( EFS.NONE );
      info.setAttribute( EFS.ATTRIBUTE_READ_ONLY, false );
   }
   
   return info;
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:33,代码来源:RuleFileStore.java


示例8: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
/** Returns info indicating this is a directory that exists. */
/* Override */
public IFileInfo fetchInfo( int options, IProgressMonitor monitor )
   throws CoreException
{
   FileInfo info = new FileInfo( getName() );
   info.setExists( true );
   info.setDirectory( true );
   info.setLength( EFS.NONE );
   info.setLastModified( EFS.NONE );
   
   return info;
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:14,代码来源:ZXTMDirectoryFileStore.java


示例9: getFileInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
@Override
public IFileInfo getFileInfo(IFileStore store) {
	IFileInfo result = infoMap.get(store);
	if (result != null) {
		return result;
	}
	return new FileInfo(store.getName());
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:9,代码来源:FileTree.java


示例10: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
@Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
	ensureLocalFileStore();
	if (localFileStore != null) {
		FileInfo fileInfo = (FileInfo) localFileStore.fetchInfo(options, monitor);
		if (path.isRoot()) {
			fileInfo.setName(path.toPortableString());
		}
		return fileInfo;
	}
	FileInfo info = new FileInfo(path.lastSegment());
	info.setExists(false);
	return info;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:15,代码来源:WorkspaceFile.java


示例11: fetchInfo

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
@Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) {
	/* DEPENDENCY ON INTERNAL API, comment out.
	if (LocalFileNatives.usingNatives()) {
		FileInfo info = LocalFileNatives.fetchFileInfo(filePath);
		// natives don't set the file name on all platforms
		if (info.getName().length() == 0)
			info.setName(file.getName());
		return info;
	} */
	
	// in-lined non-native implementation
	FileInfo info = new FileInfo(file.getName());
	final long lastModified = file.lastModified();
	if (lastModified <= 0) {
		// if the file doesn't exist, all other attributes should be default
		// values
		info.setExists(false);
		return info;
	}
	info.setLastModified(lastModified);
	info.setExists(true);
	info.setLength(file.length());
	info.setDirectory(file.isDirectory());
	info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, file.exists()
			&& !file.canWrite());
	info.setAttribute(EFS.ATTRIBUTE_HIDDEN, file.isHidden());
	return info;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:30,代码来源:LocalFileStore.java


示例12: setModificationTime

import org.eclipse.core.filesystem.provider.FileInfo; //导入依赖的package包/类
/**
 * Sets the modification time of the client file
 * 
 * @param serverFile
 * @param clientFile
 * @throws CoreException
 */
public static void setModificationTime(long modifiedTime, IFileStore destFile) throws CoreException
{
	IFileInfo fi = new FileInfo();
	fi.setLastModified(modifiedTime);
	destFile.putInfo(fi, EFS.SET_LAST_MODIFIED, null);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:14,代码来源:EFSUtils.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ListStore类代码示例发布时间:2022-05-23
下一篇:
Java ResultCodes类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap