1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.util;
16  
17  import java.io.IOException;
18  import java.io.InputStream;
19  import java.io.Reader;
20  
21  import java.util.List;
22  import java.util.Properties;
23  
24  /**
25   * <a href="File.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   * @author Alexander Chow
29   */
30  public interface File {
31  
32      public void copyDirectory(String sourceDirName, String destinationDirName);
33  
34      public void copyDirectory(java.io.File source, java.io.File destination);
35  
36      public void copyFile(String source, String destination);
37  
38      public void copyFile(String source, String destination, boolean lazy);
39  
40      public void copyFile(java.io.File source, java.io.File destination);
41  
42      public void copyFile(
43          java.io.File source, java.io.File destination, boolean lazy);
44  
45      public java.io.File createTempFile();
46  
47      public java.io.File createTempFile(String extension);
48  
49      public String createTempFileName();
50  
51      public String createTempFileName(String extension);
52  
53      public String decodeSafeFileName(String fileName);
54  
55      public boolean delete(String file);
56  
57      public boolean delete(java.io.File file);
58  
59      public void deltree(String directory);
60  
61      public void deltree(java.io.File directory);
62  
63      public String encodeSafeFileName(String fileName);
64  
65      public boolean exists(String fileName);
66  
67      public boolean exists(java.io.File file);
68  
69      public String extractText(InputStream is, String fileName);
70  
71      public String[] find(String directory, String includes, String excludes);
72  
73      public String getAbsolutePath(java.io.File file);
74  
75      public byte[] getBytes(java.io.File file) throws IOException;
76  
77      public byte[] getBytes(InputStream is) throws IOException;
78  
79      public byte[] getBytes(InputStream is, int bufferSize) throws IOException;
80  
81      public String getExtension(String fileName);
82  
83      public String getPath(String fullFileName);
84  
85      public String getShortFileName(String fullFileName);
86  
87      public boolean isAscii(java.io.File file) throws IOException;
88  
89      public String[] listDirs(String fileName);
90  
91      public String[] listDirs(java.io.File file);
92  
93      public String[] listFiles(String fileName);
94  
95      public String[] listFiles(java.io.File file);
96  
97      public void mkdirs(String pathName);
98  
99      public boolean move(String sourceFileName, String destinationFileName);
100 
101     public boolean move(java.io.File source, java.io.File destination);
102 
103     public String read(String fileName) throws IOException;
104 
105     public String read(java.io.File file) throws IOException;
106 
107     public String read(java.io.File file, boolean raw) throws IOException;
108 
109     public String replaceSeparator(String fileName);
110 
111     public java.io.File[] sortFiles(java.io.File[] files);
112 
113     public String stripExtension(String fileName);
114 
115     public List<String> toList(Reader reader);
116 
117     public List<String> toList(String fileName);
118 
119     public Properties toProperties(java.io.FileInputStream fis);
120 
121     public Properties toProperties(String fileName);
122 
123     public void write(String fileName, String s) throws IOException;
124 
125     public void write(String fileName, String s, boolean lazy)
126         throws IOException;
127 
128     public void write(String fileName, String s, boolean lazy, boolean append)
129         throws IOException;
130 
131     public void write(String pathName, String fileName, String s)
132         throws IOException;
133 
134     public void write(String pathName, String fileName, String s, boolean lazy)
135         throws IOException;
136 
137     public void write(
138             String pathName, String fileName, String s, boolean lazy,
139             boolean append)
140         throws IOException;
141 
142     public void write(java.io.File file, String s) throws IOException;
143 
144     public void write(java.io.File file, String s, boolean lazy)
145         throws IOException;
146 
147     public void write(java.io.File file, String s, boolean lazy, boolean append)
148         throws IOException;
149 
150     public void write(String fileName, byte[] bytes) throws IOException;
151 
152     public void write(java.io.File file, byte[] bytes) throws IOException;
153 
154     public void write(java.io.File file, byte[] bytes, int offset, int length)
155         throws IOException;
156 
157     public void write(String fileName, InputStream is) throws IOException;
158 
159     public void write(java.io.File file, InputStream is) throws IOException;
160 
161 }