Package org.brijframework.util.location
Class TransferUtil
- java.lang.Object
-
- org.brijframework.util.location.TransferUtil
-
public class TransferUtil extends Object
This utility class implements a method for copying a whole resorces to a new location in the file system.- Author:
- ram
-
-
Constructor Summary
Constructors Constructor Description TransferUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyDirectory(File sourceDir, File destDir)Copy a whole directory to another location.static booleancopyFile(File fromFile, File toFile)voidcopyFileChannel(File sourceFile, File destFile)Copy a file from a location to anotherstatic voidmoveFile(File moveFrom, File moveTo)static voidmoveFile(File moveFrom, File moveTo, boolean isDelete)static booleanmoveFileNewWay(File fromFile, File toFile, boolean isDelete)static voidsplitFileWithChunkSize(String mainFileName, int chunkSize)this method split main file into small packet with given chunk size
-
-
-
Method Detail
-
copyFileChannel
public void copyFileChannel(File sourceFile, File destFile) throws IOException
Copy a file from a location to another- Parameters:
sourceFile- a File object represents the source filedestFile- a File object represents the destination file- Throws:
IOException- thrown if IO error occurred.
-
copyDirectory
public void copyDirectory(File sourceDir, File destDir) throws IOException
Copy a whole directory to another location.- Parameters:
sourceDir- a File object represents the source directorydestDir- a File object represents the destination directory- Throws:
IOException- thrown if IO error occurred.
-
splitFileWithChunkSize
public static void splitFileWithChunkSize(String mainFileName, int chunkSize) throws Exception
this method split main file into small packet with given chunk size- Parameters:
mainFileName-chunkSize-- Throws:
Exception
-
copyFile
public static boolean copyFile(File fromFile, File toFile) throws IOException
- Throws:
IOException
-
moveFileNewWay
public static boolean moveFileNewWay(File fromFile, File toFile, boolean isDelete) throws IOException
- Throws:
IOException
-
-