1 package com.quadcap.io.dir; 2 3 40 41 import java.io.File ; 42 import java.io.FileInputStream ; 43 import java.io.IOException ; 44 import java.io.InputStream ; 45 46 51 public class FileEntry implements Entry { 52 File file; 53 String name; 54 55 public FileEntry(File file, String name) { 56 this.file = file; 57 this.name = name; 58 } 59 60 public String getName() { 61 return name; 62 } 63 64 public long getTime() { 65 return file.lastModified(); 66 } 67 68 public long getSize() { 69 return file.length(); 70 } 71 72 public InputStream getInputStream() throws IOException { 73 return new FileInputStream (file); 74 } 75 76 public String toString() { 77 return "FileEntry(" + file.getAbsolutePath() + ")"; 78 } 79 80 public boolean isDirectory() { 81 return file.isDirectory(); 82 } 83 } 84 | Popular Tags |