JAVA拷贝文件

	public static void CreateDBFile(String dbpath, String dbname) {
		try {
			File f = new File(dbpath);
			if (!f.exists()) {
				// Create channel on the sourcedbpath
				FileChannel srcChannel = new FileInputStream(readValue("dbPath")+dbname).getChannel();
				// Create channel on the destination
				FileChannel dstChannel = new FileOutputStream(dbpath).getChannel();
				// Copy file contents from source to destination
				dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
				// Close the channels
				srcChannel.close();
				dstChannel.close();
			}
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
 

你可能感兴趣的:(java,F#)