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

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

本文整理了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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. }
  14. this.zipFile = null;
  15. this.knownPackageNames = null;
  16. this.accessRuleSet = accessRuleSet;
  17. }

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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. }
  14. this.zipFile = null;
  15. this.knownPackageNames = null;
  16. this.accessRuleSet = accessRuleSet;
  17. }

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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. }
  14. this.zipFile = null;
  15. this.knownPackageNames = null;
  16. this.accessRuleSet = accessRuleSet;
  17. }

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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. }
  14. this.zipFile = null;
  15. this.knownPackageNames = null;
  16. this.accessRuleSet = accessRuleSet;
  17. if (externalAnnotationPath != null)
  18. this.externalAnnotationPath = externalAnnotationPath.toString();
  19. this.isOnModulePath = isOnModulePath;
  20. }

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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. }
  14. this.zipFile = null;
  15. this.knownPackageNames = null;
  16. this.accessRuleSet = accessRuleSet;
  17. if (externalAnnotationPath != null)
  18. this.externalAnnotationPath = externalAnnotationPath.toString();
  19. }

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

  1. ClasspathJar(IFile resource, AccessRuleSet accessRuleSet, IPath externalAnnotationPath, boolean isOnModulePath) {
  2. this.resource = resource;
  3. try {
  4. java.net.URI location = resource.getLocationURI();
  5. if (location == null) {
  6. this.zipFilename = ""; //$NON-NLS-1$
  7. } else {
  8. File localFile = Util.toLocalFile(location, null);
  9. this.zipFilename = localFile.getPath();
  10. }
  11. } catch (CoreException e) {
  12. // ignore
  13. this.zipFilename = ""; //$NON-NLS-1$
  14. }
  15. this.zipFile = null;
  16. this.knownPackageNames = null;
  17. this.accessRuleSet = accessRuleSet;
  18. if (externalAnnotationPath != null)
  19. this.externalAnnotationPath = externalAnnotationPath.toString();
  20. this.isOnModulePath = isOnModulePath;
  21. }

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

  1. public static File getLocalFile(IPath path) throws CoreException {
  2. File localFile = null;
  3. IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  4. IResource file = root.findMember(path);
  5. if (file != null) {
  6. // internal resource
  7. URI location;
  8. if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
  9. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  10. }
  11. localFile = Util.toLocalFile(location, null/*no progress availaible*/);
  12. if (localFile == null)
  13. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  14. } else {
  15. // external resource -> it is ok to use toFile()
  16. localFile= path.toFile();
  17. }
  18. return localFile;
  19. }

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

  1. public static File getLocalFile(IPath path) throws CoreException {
  2. File localFile = null;
  3. IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  4. IResource file = root.findMember(path);
  5. if (file != null) {
  6. // internal resource
  7. URI location;
  8. if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
  9. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  10. }
  11. localFile = Util.toLocalFile(location, null/*no progress availaible*/);
  12. if (localFile == null)
  13. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  14. } else {
  15. // external resource -> it is ok to use toFile()
  16. localFile= path.toFile();
  17. }
  18. return localFile;
  19. }

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

  1. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  2. localFile = Util.toLocalFile(location, null/*no progress availaible*/);
  3. if (localFile == null)
  4. 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

  1. throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
  2. localFile = Util.toLocalFile(location, null/*no progress availaible*/);
  3. if (localFile == null)
  4. 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

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

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

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

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

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

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

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

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

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

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

  1. if (location == null)
  2. throw new IOException("Cannot obtain a location URI for " + rscFile); //$NON-NLS-1$
  3. File file = Util.toLocalFile(location, null/*no progress monitor available*/);
  4. if (file == null)
  5. 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

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

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

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

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

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

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

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

相关文章

Util类方法