本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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());
}
示例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;
}
示例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;
}
示例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);
}