001
014
015 package com.liferay.portal.kernel.util;
016
017 import java.io.IOException;
018 import java.io.InputStream;
019 import java.io.Reader;
020
021 import java.util.List;
022 import java.util.Properties;
023
024
028 public interface File {
029
030 public void copyDirectory(java.io.File source, java.io.File destination)
031 throws IOException;
032
033 public void copyDirectory(String sourceDirName, String destinationDirName)
034 throws IOException;
035
036 public void copyFile(java.io.File source, java.io.File destination)
037 throws IOException;
038
039 public void copyFile(
040 java.io.File source, java.io.File destination, boolean lazy)
041 throws IOException;
042
043 public void copyFile(String source, String destination) throws IOException;
044
045 public void copyFile(String source, String destination, boolean lazy)
046 throws IOException;
047
048 public java.io.File createTempFile();
049
050 public java.io.File createTempFile(byte[] bytes) throws IOException;
051
052 public java.io.File createTempFile(InputStream is) throws IOException;
053
054 public java.io.File createTempFile(String extension);
055
056 public String createTempFileName();
057
058 public String createTempFileName(String extension);
059
060 public java.io.File createTempFolder();
061
062 public String decodeSafeFileName(String fileName);
063
064 public boolean delete(java.io.File file);
065
066 public boolean delete(String file);
067
068 public void deltree(java.io.File directory);
069
070 public void deltree(String directory);
071
072 public String encodeSafeFileName(String fileName);
073
074 public boolean exists(java.io.File file);
075
076 public boolean exists(String fileName);
077
078 public String extractText(InputStream is, String fileName);
079
080 public String[] find(String directory, String includes, String excludes);
081
082 public String getAbsolutePath(java.io.File file);
083
084 public byte[] getBytes(InputStream is) throws IOException;
085
086 public byte[] getBytes(InputStream is, int bufferSize) throws IOException;
087
088 public byte[] getBytes(
089 InputStream inputStream, int bufferSize, boolean cleanUpStream)
090 throws IOException;
091
092 public byte[] getBytes(java.io.File file) throws IOException;
093
094 public String getExtension(String fileName);
095
096 public String getMD5Checksum(java.io.File file) throws IOException;
097
098 public String getPath(String fullFileName);
099
100 public String getShortFileName(String fullFileName);
101
102 public boolean isAscii(java.io.File file) throws IOException;
103
104 public boolean isSameContent(java.io.File file, byte[] bytes, int length);
105
106 public boolean isSameContent(java.io.File file, String s);
107
108 public String[] listDirs(java.io.File file);
109
110 public String[] listDirs(String fileName);
111
112 public String[] listFiles(java.io.File file);
113
114 public String[] listFiles(String fileName);
115
116 public void mkdirs(String pathName);
117
118 public boolean move(java.io.File source, java.io.File destination);
119
120 public boolean move(String sourceFileName, String destinationFileName);
121
122 public String read(java.io.File file) throws IOException;
123
124 public String read(java.io.File file, boolean raw) throws IOException;
125
126 public String read(String fileName) throws IOException;
127
128 public String replaceSeparator(String fileName);
129
130 public java.io.File[] sortFiles(java.io.File[] files);
131
132 public String stripExtension(String fileName);
133
134 public List<String> toList(Reader reader);
135
136 public List<String> toList(String fileName);
137
138 public Properties toProperties(java.io.FileInputStream fis);
139
140 public Properties toProperties(String fileName);
141
142 public void touch(java.io.File file) throws IOException;
143
144 public void touch(String fileName) throws IOException;
145
146 public void unzip(java.io.File source, java.io.File destination);
147
148 public void write(java.io.File file, byte[] bytes) throws IOException;
149
150 public void write(java.io.File file, byte[] bytes, boolean append)
151 throws IOException;
152
153 public void write(java.io.File file, byte[] bytes, int offset, int length)
154 throws IOException;
155
156 public void write(
157 java.io.File file, byte[] bytes, int offset, int length,
158 boolean append)
159 throws IOException;
160
161 public void write(java.io.File file, InputStream is) throws IOException;
162
163 public void write(java.io.File file, String s) throws IOException;
164
165 public void write(java.io.File file, String s, boolean lazy)
166 throws IOException;
167
168 public void write(java.io.File file, String s, boolean lazy, boolean append)
169 throws IOException;
170
171 public void write(String fileName, byte[] bytes) throws IOException;
172
173 public void write(String fileName, InputStream is) throws IOException;
174
175 public void write(String fileName, String s) throws IOException;
176
177 public void write(String fileName, String s, boolean lazy)
178 throws IOException;
179
180 public void write(String fileName, String s, boolean lazy, boolean append)
181 throws IOException;
182
183 public void write(String pathName, String fileName, String s)
184 throws IOException;
185
186 public void write(String pathName, String fileName, String s, boolean lazy)
187 throws IOException;
188
189 public void write(
190 String pathName, String fileName, String s, boolean lazy,
191 boolean append)
192 throws IOException;
193
194 }