congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FileKey
Code IndexAdd Tabnine to your IDE (free)

How to use
FileKey
in
juzu.impl.common

Best Java code snippets using juzu.impl.common.FileKey (Showing top 20 results out of 315)

origin: org.juzu/juzu-core

public static FileKey newResourceName(String packageName, String name) {
 FileKey key = newName(packageName, name);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: org.juzu/juzu-core

public static FileKey newName(String packageName, String rawName, String ext) {
 return new FileKey(packageName, rawName, ext);
}
origin: org.juzu/juzu-core

public static FileKey newName(String packageName, String name) {
 int pos = name.indexOf('.');
 String rawName;
 String ext;
 if (pos == -1) {
  rawName = name;
  ext = "";
 } else {
  rawName = name.substring(0, pos);
  ext = name.substring(pos + 1);
 }
 return newName(packageName, rawName, ext);
}
origin: org.juzu/juzu-core

@Override
public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
 FileKey key = FileKey.newResourceName(packageName, relativeName);
 FileManager files = getFiles(location);
 if (files != null) {
  return files.getReadable(key);
 }
 else {
  throw new FileNotFoundException("Cannot write: " + location);
 }
}
origin: org.juzu/juzu-core

@Override
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException {
 FileKey key = FileKey.newResourceName(packageName, relativeName);
 // Address a bug
 if (location == StandardLocation.SOURCE_PATH) {
  FileObject file = sourcePath.getReadable(key);
  if (file == null) {
   throw new FileNotFoundException("Not found:" + key.toString());
  }
  return file;
 }
 else {
  FileManager files = getFiles(location);
  if (files != null) {
   return files.getWritable(key);
  }
  else {
   throw new FileNotFoundException("Cannot write: " + location);
  }
 }
}
origin: juzu/juzu

 @Override
 public JavaFileObject getJavaFileForOutput(Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException {
  FileManager files = getFiles(location);
  if (files != null) {
   FileKey key = FileKey.newJavaName(className, kind);
   return files.getWritable(key);
  }
  else {
   throw new UnsupportedOperationException("Location " + location + " not supported");
  }
 }
}
origin: org.juzu/juzu-core

@Override
public boolean isSameFile(FileObject a, FileObject b) {
 FileKey ka = ((JavaFileObjectImpl)a).getKey();
 FileKey kb = ((JavaFileObjectImpl)b).getKey();
 return ka.equals(kb);
}
origin: org.juzu/juzu-core

public Kind getKind() {
 return key.getKind();
}
origin: juzu/juzu

public static FileKey newName(String packageName, String name) {
 int pos = name.indexOf('.');
 String rawName;
 String ext;
 if (pos == -1) {
  rawName = name;
  ext = "";
 } else {
  rawName = name.substring(0, pos);
  ext = name.substring(pos + 1);
 }
 return newName(packageName, rawName, ext);
}
origin: juzu/juzu

@Override
public FileObject getFileForInput(Location location, String packageName, String relativeName) throws IOException {
 FileKey key = FileKey.newResourceName(packageName, relativeName);
 FileManager files = getFiles(location);
 if (files != null) {
  return files.getReadable(key);
 }
 else {
  throw new FileNotFoundException("Cannot write: " + location);
 }
}
origin: juzu/juzu

@Override
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) throws IOException {
 FileKey key = FileKey.newResourceName(packageName, relativeName);
 // Address a bug
 if (location == StandardLocation.SOURCE_PATH) {
  FileObject file = sourcePath.getReadable(key);
  if (file == null) {
   throw new FileNotFoundException("Not found:" + key.toString());
  }
  return file;
 }
 else {
  FileManager files = getFiles(location);
  if (files != null) {
   return files.getWritable(key);
  }
  else {
   throw new FileNotFoundException("Cannot write: " + location);
  }
 }
}
origin: org.juzu/juzu-core

 @Override
 public JavaFileObject getJavaFileForOutput(Location location, String className, JavaFileObject.Kind kind, FileObject sibling) throws IOException {
  FileManager files = getFiles(location);
  if (files != null) {
   FileKey key = FileKey.newJavaName(className, kind);
   return files.getWritable(key);
  }
  else {
   throw new UnsupportedOperationException("Location " + location + " not supported");
  }
 }
}
origin: juzu/juzu

@Override
public boolean isSameFile(FileObject a, FileObject b) {
 FileKey ka = ((JavaFileObjectImpl)a).getKey();
 FileKey kb = ((JavaFileObjectImpl)b).getKey();
 return ka.equals(kb);
}
origin: juzu/juzu

public Kind getKind() {
 return key.getKind();
}
origin: juzu/juzu

public static FileKey newResourceName(String packageName, String rawName, String ext) {
 FileKey key = newName(packageName, rawName, ext);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
origin: org.juzu/juzu-core

/**
 * Resolve a resource from the provided context and path.
 *
 * @param context the context of the application that will help to resolve the path source code
 * @param path the path of the resource to resolve
 * @return the resolved resource or null if it cannot be determined
 * @throws NullPointerException if any argument is null
 * @throws IllegalArgumentException if the context package is not valid
 */
public FileObject resolveResourceFromSourcePath(ElementHandle.Package context, Path.Absolute path) throws NullPointerException, IllegalArgumentException {
 return resolveResourceFromSourcePath(context, FileKey.newName(path));
}
origin: juzu/juzu

if (f.exists() && f.isFile()) {
 log.info("Resolved " + coordinates + " to " + f.getAbsolutePath());
 return new JavaFileObjectImpl<File>(StandardLocation.SOURCE_PATH, FileKey.newResourceName(pkg.toString(), relativeName.toString()), sourcePath, f);
} else {
 log.info("Resolving " + coordinates + " from source path does not exists " + f.getAbsolutePath());
origin: juzu/juzu

public static FileKey newName(String packageName, String rawName, String ext) {
 return new FileKey(packageName, rawName, ext);
}
origin: juzu/juzu

private <P> Collection<JavaFileObject> getFromSourcePath(ReadFileSystem<P> fs, String... compilationUnits) throws IOException {
 SimpleFileManager<P> manager = new SimpleFileManager<P>(StandardLocation.SOURCE_PATH, fs);
 ArrayList<String> tmp = new ArrayList<String>();
 final ArrayList<JavaFileObject> javaFiles = new ArrayList<JavaFileObject>();
 for (String compilationUnit : compilationUnits) {
  tmp.clear();
  ArrayList<String> names = Spliterator.split(compilationUnit.substring(1), '/', tmp);
  String name = tmp.get(tmp.size() - 1);
  if (!name.endsWith(".java")) {
   throw new IllegalArgumentException("Illegal compilation unit: " + compilationUnit);
  }
  P file = manager.getFileSystem().getPath(names);
  if (file == null) {
   throw new IllegalArgumentException("Could not find compilation unit: " + compilationUnit);
  }
  names.remove(names.size() - 1);
  String pkg = Tools.join('.', names);
  FileKey key = FileKey.newJavaName(pkg, name);
  javaFiles.add(manager.getReadable(key));
 }
 return javaFiles;
}
origin: juzu/juzu

public static FileKey newResourceName(String packageName, String name) {
 FileKey key = newName(packageName, name);
 if (key.getKind() == JavaFileObject.Kind.OTHER) {
  return key;
 } else {
  throw new IllegalArgumentException();
 }
}
juzu.impl.commonFileKey

Javadoc

A key for identifying a file.

Most used methods

  • newName
  • newResourceName
  • <init>
  • equals
  • getKind
  • newJavaName
  • toString

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JFileChooser (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now