public InputStream getInput(String pathname) throws FileNotFoundException { GridFile file=(GridFile)getFile(pathname); if(!file.exists()) throw new FileNotFoundException(pathname); return new GridInputStream(file, data, default_chunk_size); }
if(exists(comp)) { if(isFile(comp)) throw new IOException("cannot create " + path + " as component " + comp + " is a file");
public boolean createNewFile() throws IOException { if(exists()) return true; if(!checkParentDirs(getPath(), false)) return false; cache.put(getPath(), new Metadata(0, System.currentTimeMillis(), chunk_size, Metadata.FILE), (short)-1, 0, true); return true; }
public boolean delete(boolean synchronous) { if(!exists()) return false; if(isFile()) { fs.remove(getPath(), synchronous); // removes all the chunks belonging to the file cache.remove(getPath(), synchronous); // removes the metadata information return true; } if(isDirectory()) { File[] files=listFiles(); if(files != null && files.length > 0) return false; fs.remove(getPath(), synchronous); // removes all the chunks belonging to the file cache.remove(getPath(), synchronous); // removes the metadata information } return true; }
public InputStream getInput(String pathname) throws FileNotFoundException { GridFile file=(GridFile)getFile(pathname); if(!file.exists()) throw new FileNotFoundException(pathname); return new GridInputStream(file, data, default_chunk_size); }
if(exists(comp)) { if(isFile(comp)) throw new IOException("cannot create " + path + " as component " + comp + " is a file");
public boolean createNewFile() throws IOException { if(exists()) return true; if(!checkParentDirs(getPath(), false)) return false; cache.put(getPath(), new Metadata(0, System.currentTimeMillis(), chunk_size, Metadata.FILE), (short)-1, 0, true); return true; }
public boolean delete(boolean synchronous) { if(!exists()) return false; if(isFile()) { fs.remove(getPath(), synchronous); // removes all the chunks belonging to the file cache.remove(getPath(), synchronous); // removes the metadata information return true; } if(isDirectory()) { File[] files=listFiles(); if(files != null && files.length > 0) return false; fs.remove(getPath(), synchronous); // removes all the chunks belonging to the file cache.remove(getPath(), synchronous); // removes the metadata information } return true; }