org.eclipse.jdt.internal.core.util.Util.toLocalFile()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中org.eclipse.jdt.internal.core.util.Util.toLocalFile()方法的一些代码示例,展示了Util.toLocalFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.toLocalFile()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.core.util.Util
类名称:Util
方法名:toLocalFile

Util.toLocalFile介绍

暂无

代码示例

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
  if (externalAnnotationPath != null)
    this.externalAnnotationPath = externalAnnotationPath.toString();
  this.isOnModulePath = isOnModulePath;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
  if (externalAnnotationPath != null)
    this.externalAnnotationPath = externalAnnotationPath.toString();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) {
  this.resource = resource;
  try {
    java.net.URI location = resource.getLocationURI();
    if (location == null) {
      this.zipFilename = ""; //$NON-NLS-1$
    } else {
      File localFile = Util.toLocalFile(location, null);
      this.zipFilename = localFile.getPath();
    }
  } catch (CoreException e) {
    // ignore
    this.zipFilename = ""; //$NON-NLS-1$
  }
  this.zipFile = null;
  this.knownPackageNames = null;
  this.accessRuleSet = accessRuleSet;
  if (externalAnnotationPath != null)
    this.externalAnnotationPath = externalAnnotationPath.toString();
  this.isOnModulePath = isOnModulePath;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public static File getLocalFile(IPath path) throws CoreException {
  File localFile = null;
  IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  IResource file = root.findMember(path);
  if (file != null) {
    // internal resource
    URI location;
    if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
      throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
    }
    localFile = Util.toLocalFile(location, null/*no progress availaible*/);
    if (localFile == null)
      throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  } else {
    // external resource -> it is ok to use toFile()
    localFile= path.toFile();
  }
  return localFile;
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public static File getLocalFile(IPath path) throws CoreException {
  File localFile = null;
  IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  IResource file = root.findMember(path);
  if (file != null) {
    // internal resource
    URI location;
    if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
      throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
    }
    localFile = Util.toLocalFile(location, null/*no progress availaible*/);
    if (localFile == null)
      throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  } else {
    // external resource -> it is ok to use toFile()
    localFile= path.toFile();
  }
  return localFile;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
localFile = Util.toLocalFile(location, null/*no progress availaible*/);
if (localFile == null)
  throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
localFile = Util.toLocalFile(location, null/*no progress availaible*/);
if (localFile == null)
  throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file != null && file.exists()) {
  byte[] bytes;

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file != null && file.exists()) {
  byte[] bytes;

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file != null && file.exists()) {
  byte[] bytes;

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file != null && file.exists()) {
  byte[] bytes;

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

if (location == null)
  throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
File file = Util.toLocalFile(location, null/*no progress monitor available*/);
if (file == null)
  throw new IOException("Unable to fetch file from " + location); //$NON-NLS-1$

相关文章

微信公众号

最新文章

更多

Util类方法