congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
DiskFileSystem
Code IndexAdd Tabnine to your IDE (free)

How to use
DiskFileSystem
in
juzu.impl.fs.spi.disk

Best Java code snippets using juzu.impl.fs.spi.disk.DiskFileSystem (Showing top 20 results out of 315)

origin: org.juzu/juzu-core

public static ReadFileSystem<?> create(URL url) throws IOException {
 String protocol = url.getProtocol();
 if (protocol.equals("jar")) {
  String path = url.getPath();
  int pos = path.lastIndexOf("!/");
  URL nested = new URL(path.substring(0, pos));
  if (nested.getProtocol().equals("file")) {
   return new JarFileSystem(url);
  } else {
   throw new IOException("Cannot handle nested jar URL " + url);
  }
 } else if (protocol.equals("file")) {
  File f;
  try {
   f = new File(url.toURI());
  }
  catch (URISyntaxException e) {
   throw new IOException(e);
  }
  if (f.isDirectory()) {
   return new DiskFileSystem(f);
  } else {
   return new JarFileSystem(url);
  }
 } else {
  throw new IOException("Unsupported URL: " + url);
 }
}
origin: org.juzu/juzu-core

@Override
public void populateRoots(Set<File> roots) throws IOException {
 if (fs instanceof DiskFileSystem) {
  roots.add(((DiskFileSystem)fs).getRoot());
 }
}
origin: org.juzu/juzu-core

DiskFileSystem sourceOutput = new DiskFileSystem(sourceOutputDir);
DiskFileSystem classOutput = new DiskFileSystem(classOutputDir);
String relativePath = packageName.toString().replace('.', '/') + '/';
assertTrue(new File(sourcePathDir, relativePath).mkdirs());
DiskFileSystem sourcePath = new DiskFileSystem(sourcePathDir);
URL url = Thread.currentThread().getContextClassLoader().getResource(relativePath);
if (url == null) {
 URLFileSystem fs = new URLFileSystem();
 fs.add(url);
 fs.copy(sourcePath, sourcePath.getPath(packageName));
origin: org.juzu/juzu-core

    sourcePathMap.put(context, sourcePath = new DiskFileSystem(dir));
log.info("Found cached source path " + sourcePath.getDescription() + " for package " + context.getPackageName());
origin: org.juzu/juzu-core

assertEquals(null, error.getCode());
assertEquals(Collections.<String>emptyList(), error.getArguments());
assertEquals(fs.getPath("compiler", "annotationexception", "A.java"), error.getSourceFile());
assertTrue(error.getMessage().contains("the_message"));
assertNotNull(error.getSourceFile());
origin: juzu/juzu

DiskFileSystem sourceOutput = new DiskFileSystem(sourceOutputDir);
DiskFileSystem classOutput = new DiskFileSystem(classOutputDir);
String relativePath = packageName.toString().replace('.', '/') + '/';
assertTrue(new File(sourcePathDir, relativePath).mkdirs());
DiskFileSystem sourcePath = new DiskFileSystem(sourcePathDir);
URL url = Thread.currentThread().getContextClassLoader().getResource(relativePath);
if (url == null) {
 URLFileSystem fs = new URLFileSystem();
 fs.add(url);
 fs.copy(sourcePath, sourcePath.getPath(packageName));
origin: juzu/juzu

    sourcePathMap.put(context, sourcePath = new DiskFileSystem(dir));
log.info("Found cached source path " + sourcePath.getDescription() + " for package " + context.getPackageName());
origin: juzu/juzu

assertEquals(null, error.getCode());
assertEquals(Collections.<String>emptyList(), error.getArguments());
assertEquals(fs.getPath("compiler", "annotationexception", "A.java"), error.getSourceFile());
assertTrue(error.getMessage().contains("the_message"));
assertNotNull(error.getSourceFile());
origin: juzu/juzu

public static ReadFileSystem<?> create(URL url) throws IOException {
 String protocol = url.getProtocol();
 if (protocol.equals("jar")) {
  String path = url.getPath();
  int pos = path.lastIndexOf("!/");
  URL nested = new URL(path.substring(0, pos));
  if (nested.getProtocol().equals("file")) {
   return new JarFileSystem(url);
  } else {
   throw new IOException("Cannot handle nested jar URL " + url);
  }
 } else if (protocol.equals("file")) {
  File f;
  try {
   f = new File(url.toURI());
  }
  catch (URISyntaxException e) {
   throw new IOException(e);
  }
  if (f.isDirectory()) {
   return new DiskFileSystem(f);
  } else {
   return new JarFileSystem(url);
  }
 } else {
  throw new IOException("Unsupported URL: " + url);
 }
}
origin: juzu/juzu

@Override
public void populateRoots(Set<File> roots) throws IOException {
 if (fs instanceof DiskFileSystem) {
  roots.add(((DiskFileSystem)fs).getRoot());
 }
}
origin: org.juzu/juzu-core

public static DiskFileSystem diskFS(Name packageName) {
 File root = new File(System.getProperty("juzu.test.resources.path"));
 return new DiskFileSystem(root, packageName);
}
origin: juzu/juzu

@Override
public void processAnnotationChange(ModuleMetaModel metaModel, AnnotationChange change) {
 ElementHandle<?> elt = change.getKey().getElement();
 if (elt instanceof ElementHandle.Package) {
  ElementHandle.Package pkgElt = (ElementHandle.Package)elt;
  DiskFileSystem fs = metaModel.getProcessingContext().getSourcePath(pkgElt);
  if (fs != null) {
   metaModel.root = fs.getRoot();
  }
 }
 super.processAnnotationChange(metaModel, change);
}
origin: org.juzu/juzu-core

public static DiskFileSystem diskFS(String packageName) {
 File root = new File(System.getProperty("juzu.test.resources.path"));
 return new DiskFileSystem(root, packageName);
}
origin: org.juzu/juzu-core

@Override
public void processAnnotationChange(ModuleMetaModel metaModel, AnnotationChange change) {
 ElementHandle<?> elt = change.getKey().getElement();
 if (elt instanceof ElementHandle.Package) {
  ElementHandle.Package pkgElt = (ElementHandle.Package)elt;
  DiskFileSystem fs = metaModel.getProcessingContext().getSourcePath(pkgElt);
  if (fs != null) {
   metaModel.root = fs.getRoot();
  }
 }
 super.processAnnotationChange(metaModel, change);
}
origin: juzu/juzu

public static DiskFileSystem diskFS(Name packageName) {
 File root = new File(System.getProperty("juzu.test.resources.path"));
 return new DiskFileSystem(root, packageName);
}
origin: juzu/juzu

public static DiskFileSystem diskFS(String packageName) {
 File root = new File(System.getProperty("juzu.test.resources.path"));
 return new DiskFileSystem(root, packageName);
}
origin: org.juzu/juzu-core

public final ReadFileSystem<?> getSourcePath() {
 if (sourcePath == null) {
  String sourcePathParam = getInitParameter(SOURCE_PATH);
  if (sourcePathParam != null) {
   sourcePath = new DiskFileSystem(new File(sourcePathParam));
  } else {
   try {
    URL configURL = getClassLoader().getResource("juzu/config.json");
    if (configURL != null) {
     String configValue = Tools.read(configURL);
     JSON config = (JSON)JSON.parse(configValue);
     String sourcePathValue = config.getString("sourcepath");
     if (sourcePathValue != null) {
      File sourcePathRoot = new File(sourcePathValue);
      if (sourcePathRoot.isDirectory() && sourcePathRoot.exists()) {
       sourcePath = new DiskFileSystem(sourcePathRoot);
      }
     }
    }
   }
   catch (IOException e) {
    e.printStackTrace();
   }
  }
 }
 return sourcePath;
}
origin: juzu/juzu

public final ReadFileSystem<?> getSourcePath() {
 if (sourcePath == null) {
  String sourcePathParam = getInitParameter(SOURCE_PATH);
  if (sourcePathParam != null) {
   sourcePath = new DiskFileSystem(new File(sourcePathParam));
  } else {
   try {
    URL configURL = getClassLoader().getResource("juzu/config.json");
    if (configURL != null) {
     String configValue = Tools.read(configURL);
     JSON config = (JSON)JSON.parse(configValue);
     String sourcePathValue = config.getString("sourcepath");
     if (sourcePathValue != null) {
      File sourcePathRoot = new File(sourcePathValue);
      if (sourcePathRoot.isDirectory() && sourcePathRoot.exists()) {
       sourcePath = new DiskFileSystem(sourcePathRoot);
      }
     }
    }
   }
   catch (IOException e) {
    e.printStackTrace();
   }
  }
 }
 return sourcePath;
}
origin: org.juzu/juzu-core

File root = new File(split.next());
if (root.isDirectory()) {
 sourcePath = new DiskFileSystem(root);
origin: org.juzu/juzu-core

protected final void init(String pkg) throws Exception {
 File root = new File(AbstractInjectTestCase.class.getProtectionDomain().getCodeSource().getLocation().toURI());
 assertTrue(root.exists());
 assertTrue(root.isDirectory());
 init(new DiskFileSystem(root, pkg), Thread.currentThread().getContextClassLoader());
}
juzu.impl.fs.spi.diskDiskFileSystem

Most used methods

  • <init>
  • getDescription
  • getPath
  • getRoot

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Reference (javax.naming)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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