public void copyDirectory(File srcPath, File dstPath) throws IOException{
if (srcPath.isDirectory()){
if (!dstPath.exists()){
dstPath.mkdir();
}
String files[] = srcPath.list();
for(int i = 0; i < files.length; i++){
copyDirectory(new File(srcPath, files[i]),
new File(dstPath, files[i]));
}
}
else{
if(!srcPath.exists()){
System.out.println("File or directory does not exist.");
System.exit(0);
}
else
{
InputStream in = new FileInputStream(srcPath);
OutputStream out = new FileOutputStream(dstPath);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}
System.out.println("Directory copied.");
}
分享到:
相关推荐
copy the contents of the 'include' directory somewhere as well, for example into '/usr/local/include/'. Please refer to our official github site for more installation instructions: ...
Second Copy is the perfect automatic backup software designed for Windows XP and above including Windows 8.... So, once it is set up you always have a backup of your data somewhere else.
Copy ct directory to any directory you like. % cp -pR $ORGDIR/ct-snmpv2c-ag-X.X $SOMEWHERE/ct-snmpv2c-ag-X.X % chmod -R +w $SOMEWHERE/ct-snmpv2c-ag-X.X 4. Setup ct environment % (enable TN's ipv6...
This was due to a problem where it would be freed automatically if there was a problem with the ArchiveStream when trying to open it as a zip file (possibly corrupt). Best practice is that ...
- Changes to correct a BurnInTest crash problem on some systems. When the disk and standard RAM tests are run for many hours, BurnInTest may have disappeared with no error message. Release 5.3 ...
The code is released under the GNU General Public Licence so you're welcome to use the code however you would like to but please put a reference to me (Nick Malleson) or to this page somewhere....
Run the following commands to migrate your framework directory Apktool will work fine without running these commands, this will just cleanup abandoned files unix - mkdir -p ~/.local/share; mv ~/...
If you downloaded it from somewhere else, please let us now: http://www.dll-files.com/contact.php Installation instructions: Open the zip-file you downloaded from DLL-files.com. Extract the .dll-...
Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, ...
You can simply launch the "Terraria_v1.3.5.3.exe" file in the install directory to launch the vanilla Terraria Client. If that file launches tModLoader or you wish to permanently revery to un-modded ...
Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, ...
This separates the implementation from the class definition, while still allowing the implementation to be included where necessary. Another use of -inl.h files is for definitions of function ...
the contents to the same directory where you extracted Drupal into. 2. CREATE THE CONFIGURATION FILE AND GRANT WRITE PERMISSIONS Drupal comes with a default.settings.php file in the sites/default ...
Remove or copy to other directory files of old version to prevent crossing old and new version of EhLib (Including EhLib.bpl, EhLib.dcp or EhLibXX.bpl, EhLibXX.dcp, EhLibDataDriversXX, ...
not copied to the <Windows>\INF directory. Refer to Section 4 for more information. ************************************************************ * 4. LIST OF AVAILABLE COMMAND LINE FLAG OPTIONS ...
Ability to print/preview page header and page footer where you can specify macros for current page, current date, current time and/or static text. Automatically print/preview multiselected area ...
Copy the imageUSB directory to the Program Files directory. To uninstall imageUSB ===================== Delete the directory to the Program Files directory. Requirements ============ - Operating ...
runtime, put the following somewhere in your source files: extern void _floatconvert(); #pragma extref _floatconvert This will force inclusion of floating point formats, which may not be linked...
are fundamental tasks, show you how to define functions in Go, where the defer keyword is mentioned for the first time in this book and continue by discussing the data structures that Go offers using ...
runtime, put the following somewhere in your source files: extern void _floatconvert(); #pragma extref _floatconvert This will force inclusion of floating point formats, which may not be linked...