1   package com.atlassian.bonnie.search;
2   
3   import com.atlassian.bonnie.Searchable;
4   
5   import java.io.InputStream;
6   import java.io.IOException;
7   
8   /**
9    * An object representing some searchable file.
10   */
11  public interface SearchableAttachment extends Searchable
12  {
13      /**
14       * Gets the MIME content-type of this attachment. If there is no content-type,
15       * return "application/x-unknown". Should never return null.
16       *
17       * @return the MIME content-type of the attachment, or "application/x-unknown"
18       *         if the MIME type is unknown
19       */
20      String getContentType();
21  
22      /**
23       * Gets the filename of this attachment. If there is no filename, return
24       * the empty string. This method should never return null.
25       *
26       * @return the filename of this attachment, or the empty string if there is
27       *         no filename
28       */
29      String getFileName();
30  
31      /**
32       * Return the contents of the attachment as an InputStream
33       *
34       * @return an InputStream set at the start of the attachment's contents.
35       */
36      InputStream getContentsAsStream() throws IOException;
37  
38      /**
39       * Return any comment associated with this attachment
40       */
41      String getComment();
42  
43      String getNiceType();
44  
45      String getNiceFileSize();
46  
47      String getDownloadPath();
48  }