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

How to use
newResourceName
method
in
juzu.impl.common.FileKey

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

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: 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: 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 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

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: org.juzu/juzu-core

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: org.juzu/juzu-core

@Test
public void testGetResourceFromClassPath() throws Exception {
 File fic = File.createTempFile("test", ".jar");
 fic.deleteOnExit();
 JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
 jar.addAsResource(new StringAsset("the_resource"), "resource.txt");
 jar.as(ZipExporter.class).exportTo(fic, true);
 JarFileSystem classpath = new JarFileSystem(new JarFile(fic));
 RAMFileSystem output = new RAMFileSystem();
 Compiler compiler = Compiler.builder().
   javaCompiler(compilerProvider).
   config(new CompilerConfig().force(true)).
   addClassPath(classpath).
   sourcePath(new RAMFileSystem()).
   output(output).build();
 GetResource processor = new GetResource(StandardLocation.CLASS_PATH, FileKey.newResourceName("", "resource.txt"));
 compiler.addAnnotationProcessor(processor);
 compiler.compile();
 processor.assertResource("the_resource");
}
origin: juzu/juzu

@Test
public void testGetResourceFromClassPath() throws Exception {
 File fic = File.createTempFile("test", ".jar");
 fic.deleteOnExit();
 JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
 jar.addAsResource(new StringAsset("the_resource"), "resource.txt");
 jar.as(ZipExporter.class).exportTo(fic, true);
 JarFileSystem classpath = new JarFileSystem(new JarFile(fic));
 RAMFileSystem output = new RAMFileSystem();
 Compiler compiler = Compiler.builder().
   javaCompiler(compilerProvider).
   config(new CompilerConfig().force(true)).
   addClassPath(classpath).
   sourcePath(new RAMFileSystem()).
   output(output).build();
 GetResource processor = new GetResource(StandardLocation.CLASS_PATH, FileKey.newResourceName("", "resource.txt"));
 compiler.addAnnotationProcessor(processor);
 compiler.compile();
 processor.assertResource("the_resource");
}
origin: juzu/juzu

@Test
public void testGetResourceFromSourcePath() throws Exception {
 DiskFileSystem input = diskFS("compiler.getresource");
 RAMFileSystem output = new RAMFileSystem();
 Compiler compiler = Compiler.builder().javaCompiler(compilerProvider).sourcePath(input).output(output).build();
 GetResource processor = new GetResource(StandardLocation.SOURCE_PATH, FileKey.newResourceName("compiler.getresource", "A.txt"));
 compiler.addAnnotationProcessor(processor);
 compiler.compile();
 assertEquals(1, output.size(ReadFileSystem.FILE));
 processor.assertResource("value");
}
origin: org.juzu/juzu-core

@Test
public void testGetResourceFromSourcePath() throws Exception {
 DiskFileSystem input = diskFS("compiler.getresource");
 RAMFileSystem output = new RAMFileSystem();
 Compiler compiler = Compiler.builder().javaCompiler(compilerProvider).sourcePath(input).output(output).build();
 GetResource processor = new GetResource(StandardLocation.SOURCE_PATH, FileKey.newResourceName("compiler.getresource", "A.txt"));
 compiler.addAnnotationProcessor(processor);
 compiler.compile();
 assertEquals(1, output.size(ReadFileSystem.FILE));
 processor.assertResource("value");
}
juzu.impl.commonFileKeynewResourceName

Popular methods of FileKey

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

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • 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 plugins for Android Studio
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