public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI() .toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI() .toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI() .toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI().toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI() .toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI().toURL(); }
public static URL toURL(String s, File base) throws MalformedURLException { int n = s.indexOf(':'); if (n > 0 && n < 10) { // is url return new URL(s); } return getFile(base, s).toURI() .toURL(); }
public static File getBasedFile(File base, String file) throws IOException { base = base.getCanonicalFile(); File child = getFile(base, file); if (child.getCanonicalPath() .startsWith(base.getCanonicalPath())) { return child; } throw new IOException("The file " + child + " is outside of the base " + base); }
public String _osfile(String args[]) { verifyCommand(args, _fileHelp, null, 3, 3); File base = new File(args[1]); File f = IO.getFile(base, args[2]); return f.getAbsolutePath(); }
public String _osfile(String args[]) { verifyCommand(args, _fileHelp, null, 3, 3); File base = new File(args[1]); File f = IO.getFile(base, args[2]); return f.getAbsolutePath(); }
public File getDir(String file, String notfound) { File f = IO.getFile(base, file); if (!f.isDirectory() && notfound != null) { error(notfound, f.getAbsolutePath()); f = null; } return f; }
public String _osfile(String args[]) { verifyCommand(args, _fileHelp, null, 3, 3); File base = new File(args[1]); File f = IO.getFile(base, args[2]); return f.getAbsolutePath(); }
public String _fileuri(String args[]) throws Exception { Macro.verifyCommand(args, _fileuri, null, 2, 2); File f = IO.getFile(getBase(), args[1]) .getCanonicalFile(); return f.toURI() .toString(); }
/** * Return a file relative to the base. */ public File getFile(String file, String notfound) { File f = IO.getFile(getBase(), file); if (!f.isFile() && notfound != null) { error(notfound, f.getAbsolutePath()); f = null; } return f; } public File getDir(String file, String notfound) {
public void checkStructure() { if (!buildDir.isDirectory()) error("No directory for cnf %s", buildDir); else { File build = IO.getFile(buildDir, "build.bnd"); if (build.isFile()) { error("No build.bnd file in %s", buildDir); } } }
/** * Delete a cache entry */ @Override public boolean deleteCache(byte[] id) throws Exception { File dir = IO.getFile(cache, Hex.toHexString(id)); if (dir.isDirectory()) { IO.delete(dir); return true; } return false; }
/** * Delete a cache entry */ public boolean deleteCache(byte[] id) throws Exception { File dir = IO.getFile(cache, Hex.toHexString(id)); if (dir.isDirectory()) { IO.delete(dir); return true; } return false; }
/** * Delete a cache entry */ public boolean deleteCache(byte[] id) throws Exception { File dir = IO.getFile(cache, Hex.toHexString(id)); if (dir.isDirectory()) { IO.delete(dir); return true; } return false; }
private Workspace(WorkspaceLayout layout) throws Exception { super(getDefaults()); this.layout = layout; setBuildDir(IO.getFile(BND_DEFAULT_WS, CNFDIR)); projects = new ProjectTracker(this); }
public void checkStructure() { if (!getBuildDir().isDirectory()) error("No directory for cnf %s", getBuildDir()); else { File build = IO.getFile(getBuildDir(), BUILDFILE); if (build.isFile()) { error("No %s file in %s", BUILDFILE, getBuildDir()); } } }