Package com.sforce.ws.util
Class FileUtil
- java.lang.Object
-
- com.sforce.ws.util.FileUtil
-
public class FileUtil extends Object
This class contains util method related to File handeling.- Since:
- 1.0 Nov 11, 2005
- Version:
- 1.0
- Author:
- http://cheenath.com
-
-
Constructor Summary
Constructors Constructor Description FileUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcopy(InputStream from, boolean closeInput, OutputStream to, boolean closeOutput)static voidcopy(InputStream from, OutputStream to)static voidcopy(InputStream from, OutputStream to, boolean closeOutput)static booleandeleteDir(File dir)static FilegetSystemTempDirectory(File parentTempDir)static List<File>listFilesRecursive(File dir, boolean includeDirs)static FilemakeTempDirectory(File parentTempDir, String dirName, boolean deleteIfExists)static FilemakeTempDirectory(String dirName, boolean deleteIfExists)static Filemkdirs(String packageName, File root)static byte[]toBytes(InputStream in)static StringtoString(File file)
-
-
-
Field Detail
-
EOL
public static final String EOL
end of line
-
-
Method Detail
-
toString
public static String toString(File file) throws IOException
- Parameters:
file-- Returns:
- Throws:
IOException
-
toBytes
public static byte[] toBytes(InputStream in) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, OutputStream to) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, OutputStream to, boolean closeOutput) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, boolean closeInput, OutputStream to, boolean closeOutput) throws IOException
- Throws:
IOException
-
deleteDir
public static boolean deleteDir(File dir)
-
makeTempDirectory
public static File makeTempDirectory(String dirName, boolean deleteIfExists) throws IOException
- Throws:
IOException
-
makeTempDirectory
public static File makeTempDirectory(File parentTempDir, String dirName, boolean deleteIfExists) throws IOException
- Throws:
IOException
-
getSystemTempDirectory
public static File getSystemTempDirectory(File parentTempDir) throws IOException
- Throws:
IOException
-
-