1 2 3 package net.nutch.ndfs; 4 5 import java.io.*; 6 import java.net.*; 7 import java.util.*; 8 9 10 16 public class NDFSFile extends File { 17 NDFSFileInfo info; 18 19 21 public NDFSFile(NDFSFileInfo info) { 22 super(info.getPath()); 23 this.info = info; 24 } 25 26 29 public boolean canRead() { 30 return false; 31 } 32 public boolean canWrite() { 33 return false; 34 } 35 public boolean createNewFile() { 36 return false; 37 } 38 public boolean delete() { 39 return false; 40 } 41 public void deleteOnExit() { 42 } 43 public boolean isHidden() { 44 return false; 45 } 46 47 50 public boolean isDirectory() { 51 return info.isDir(); 52 } 53 public boolean isFile() { 54 return ! isDirectory(); 55 } 56 public long length() { 57 return info.getLen(); 58 } 59 60 63 public long getContentsLength() { 64 return info.getContentsLen(); 65 } 66 } 67 | Popular Tags |