Java Code Examples for org.eclipse.core.filesystem.provider.FileInfo#setExists()

The following examples show how to use org.eclipse.core.filesystem.provider.FileInfo#setExists() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SftpFileStore.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Converts a jsch attributes object to an EFS file info.
 */
private static FileInfo attrsToInfo(String fileName, SftpATTRS stat) {
	FileInfo info = new FileInfo(fileName);
	info.setExists(true);
	info.setDirectory(stat.isDir());
	info.setLength(stat.getSize());
	info.setLastModified(((long) stat.getMTime()) * 1000);
	return info;
}
 
Example 2
Source File: HistoryFileStore.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor)
		throws CoreException {
	FileInfo fileInfo = new FileInfo(getName());
	fileInfo.setDirectory(false);
	fileInfo.setLastModified(fileState.getModificationTime());
	fileInfo.setExists(true);
	fileInfo.setAttribute(EFS.ATTRIBUTE_READ_ONLY, true);
	return fileInfo;
}
 
Example 3
Source File: WorkspaceFile.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
@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;
}