comparison servlet/src/digilib/io/ImageFile.java @ 576:dad720e9b12b stream

try: DocuDirent as interface, ImageFile inherits from ImageInput and implements DocuDirent
author robcast
date Wed, 22 Dec 2010 20:19:06 +0100
parents 790cbfb58b52
children 7357ad8f9f42
comparison
equal deleted inserted replaced
574:790cbfb58b52 576:dad720e9b12b
48 this.dir = new Directory(f.getParentFile()); 48 this.dir = new Directory(f.getParentFile());
49 this.filename = f.getName(); 49 this.filename = f.getName();
50 } 50 }
51 51
52 52
53 @Override
54 public boolean hasFile() {
55 // this is File-based
56 return true;
57 }
58
59 /** Returns the file name (without path). 53 /** Returns the file name (without path).
60 * 54 *
61 * @return 55 * @return
62 */ 56 */
63 public String getName() { 57 public String getName() {
66 60
67 61
68 /** 62 /**
69 * @return File 63 * @return File
70 */ 64 */
71 @Override
72 public File getFile() { 65 public File getFile() {
73 if (dir == null) { 66 if (dir == null) {
74 return null; 67 return null;
75 } 68 }
76 File f = new File(dir.getDir(), filename); 69 File f = new File(dir.getDir(), filename);
101 if (this.parent != null) { 94 if (this.parent != null) {
102 this.parent.setAspect(imageSize); 95 this.parent.setAspect(imageSize);
103 } 96 }
104 } 97 }
105 98
99 /* (non-Javadoc)
100 * @see java.lang.Object#toString()
101 */
102 @Override
103 public String toString() {
104 // try to use File.toString
105 File f = getFile();
106 if (f != null) {
107 return f.toString();
108 }
109 return super.toString();
110 }
111
112
106 } 113 }