KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pentaho > core > repository > IContentItemFile


1 /*
2  * Copyright 2006 Pentaho Corporation. All rights reserved.
3  * This software was developed by Pentaho Corporation and is provided under the terms
4  * of the Mozilla Public License, Version 1.1, or any later version. You may not use
5  * this file except in compliance with the license. If you need a copy of the license,
6  * please go to http://www.mozilla.org/MPL/MPL-1.1.txt. The Original Code is the Pentaho
7  * BI Platform. The Initial Developer is Pentaho Corporation.
8  *
9  * Software distributed under the Mozilla Public License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
11  * the license for the specific language governing your rights and limitations.
12  *
13  * @created Jul 1, 2005
14  * @author Marc Batchelor
15  *
16  */

17
18 package org.pentaho.core.repository;
19
20 import java.util.*;
21 import java.io.*;
22
23 import org.pentaho.core.repository.content.ContentException;
24
25 /**
26  * There is no access to this class outside of this package.
27  */

28 public interface IContentItemFile {
29
30     /**
31      * @return The file name on disk.
32      */

33     public String JavaDoc getOsFileName();
34
35     /**
36      * @return The path to the file on disk
37      */

38     public String JavaDoc getOsPath();
39
40     /**
41      * @return The action name that created this file
42      */

43     public String JavaDoc getActionName();
44
45     /**
46      * @return The Id of this file
47      */

48     public String JavaDoc getId();
49
50     /**
51      * @return The file size
52      */

53     public long getFileSize();
54
55     /**
56      * @return The file date/time
57      */

58     public Date getFileDateTime();
59
60     /**
61      * @return An input stream from the file on disk
62      * @throws ContentException
63      */

64     public InputStream getInputStream() throws ContentException;
65
66     /**
67      * @return A Reader from the file on disk.
68      * @throws ContentException
69      */

70     public Reader getReader() throws ContentException;
71
72     /**
73      * @param overWriteOk
74      * Indicates whether overwriting the file on disk is ok.
75      * (determined by the write mode of the containing ContentItem).
76      * @return An OutputStream to write to
77      * @throws ContentException
78      */

79     public OutputStream getOutputStream(boolean overWriteOk) throws ContentException;
80
81     /**
82      * @param overWriteOk
83      * Indicates whether overwriting the file on disk is ok.
84      * (determined by the write mode of the containing ContentItem).
85      * @param append
86      * Indicates whether to append to the file.
87      * @return An OutputStream to write to
88      * @throws ContentException
89      */

90     public OutputStream getOutputStream(boolean overWriteOk, boolean append) throws ContentException;
91
92     /**
93      * Copies the latest file to another location
94      *
95      * @param newFileName
96      * File name to copy to. Must be fully qualified.
97      * @return Number of bytes copied
98      * @throws ContentException
99      */

100     public long copyToFile(String JavaDoc newFileName) throws ContentException;
101
102     /**
103      * Deletes the file in the Operating System
104      *
105      * @return Success indicator
106      */

107     public boolean deleteOsFile();
108
109 }
110
Popular Tags