View Javadoc

1   /*
2    * 
3    * 
4    */
5   package example.filestorage;
6   
7   import java.io.InputStream;
8   import java.io.OutputStream;
9   
10  /***
11   * 
12   * File Storage Data Access Object
13   * 
14   * @author Sean C. Sullivan
15   * 
16   */
17  public interface FileStorageDAO
18  {
19  	public FileInfo getFileInfo(long id);
20  	public FileInfo getFileInfo(String filename);
21  	
22  	/***
23  	 * 
24  	 * @return a list that contains zero or more {@link FileInfo} objects
25  	 * 
26  	 */
27  	public java.util.List getAllFiles();
28  	
29  	public long saveFile(String filename, InputStream is, int filesize);
30  
31  	public void overwriteFile(long id, InputStream is, int filesize);
32  
33  	public boolean deleteFile(long id);
34  	
35  	public boolean fileExists(String filename);
36  	
37  	public void getFileData(long id, OutputStream out);
38  	public byte[] getFileData(long id);
39  	
40  }