Package org.sugarj.common.path

Examples of org.sugarj.common.path.AbsolutePath


  public static Path newTempFile(String suffix) throws IOException {
    File f =
        File.createTempFile(
            "sugarj",
            suffix == null || suffix.isEmpty() ? suffix : "." + suffix);
    final Path p = new AbsolutePath(f.getAbsolutePath());
   
    return p;
  }
View Full Code Here


    if (parent == null)
      return;
    else if (parent.equals(TMP_DIR))
      delete(file);
    else
      deleteTempFiles(new AbsolutePath(parent));
  }
View Full Code Here

    if (file == null)
      return;
   
    if (file.getFile().listFiles() != null)
      for (File f : file.getFile().listFiles())
        FileCommands.delete(new AbsolutePath(f.getPath()));
   
    file.getFile().delete();
  }
View Full Code Here

    fos.write(content.getBytes());
    fos.close();
  }

  public static String readFileAsString(File file) throws IOException {
    return readFileAsString(new AbsolutePath(file.getAbsolutePath()));
  }
View Full Code Here

    reader.close();
    return fileData.toString();
  }
 
  public static String fileName(URL url) {
    return fileName(new AbsolutePath(url.getPath()));
  }
View Full Code Here

    return fileName(new AbsolutePath(url.getPath()));
  }
 
 
  public static String fileName(URI uri) {
    return fileName(new AbsolutePath(uri.getPath()));
  }
View Full Code Here

  public static Path newTempDir() throws IOException {
    final File f = File.createTempFile("SugarJ", "");
    // need to delete the file, but want to reuse the filename
    f.delete();
    f.mkdir();
    final Path p = new AbsolutePath(f.getAbsolutePath());
   
    return p;
  }
View Full Code Here

      map.put(grammarFile.getAbsolutePath(), FileCommands.fileHash(grammarFile));
      ModuleKey key = new ModuleKey(map, "");
      Path permissiveGrammar = lookupGrammarInCache(sdfCache, key);
      if (permissiveGrammar == null) {
        permissiveGrammar = FileCommands.newTempFile("def");
        makePermissive(new AbsolutePath(grammarFile.getAbsolutePath()), permissiveGrammar);
        permissiveGrammar = cacheParseTable(sdfCache, key, permissiveGrammar, environment);
      }
     
      cmd.add("-Idef");
      cmd.add(FileCommands.nativePath(permissiveGrammar.getAbsolutePath()));
View Full Code Here

            modelDeps.contains(p) ||
            transDeps.contains(p);
        Result pRes = null;
        if (!ok) {
          // transformations may generate other artifacts, given that their dependencies in turn are marked in the current result
          Path dep = new AbsolutePath(FileCommands.dropExtension(p.getAbsolutePath()) + ".dep");
          if (FileCommands.exists(dep)) {
            pRes = Result.readDependencyFile(dep);
            if (pRes != null && pRes.isGenerated()) {
              boolean isContained = transformedModelDeps.containsAll(pRes.getCircularFileDependencies(environment));
              ok = isContained;
View Full Code Here

    return driver.driverResult;
  }
 
  private void init(ToplevelDeclarationProvider declProvider, RelativePath sourceFile, IProgressMonitor monitor) throws FileNotFoundException, IOException, InvalidParseTableException {
    this.monitor = monitor;
    environment.addToIncludePath(new AbsolutePath(baseLanguage.getPluginDirectory().getAbsolutePath()));
 
    depOutFile = null;
 
    this.sourceFile = sourceFile;
    this.declProvider = declProvider;
View Full Code Here

TOP

Related Classes of org.sugarj.common.path.AbsolutePath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.