Blackberry - How to copy files to SD card using input/output stream
I am trying to copy my blackberry assets folder to the SD card using the Input/Output stream however I cannot seem to get this to work, can some please advice what i am doing wrong:

	String[] resourseFileNames = {"file1","file2"."file3"};
	final int length = resourseFileNames.length;
	String currentProcessingResourceName;
	for(int i=0; i<length; i++)
	{	
		currentProcessingResourceName = resourseFileNames[i];
		conn = (FileConnection) Connector.open( "file:///store/home/user/sample/www",
		Connector.READ_WRITE );
		InputStream in = new FileInputStream(currentProcessingResourceName);
		OutputStream out = new OutputStream("file:///SDCard/myAppName/www");
		
		 // Copy the bits from instream to outstream
		byte[] buf = new byte[1024];
		int len;
		while ((len = in.read(buf)) > 0) {
			out.write(buf, 0, len);
		}
		in.close();
		out.close();
	}

I am using phonegap of that makes any difference. Thanks.
Blackberry - How to copy files to SD card using input/output stream
===

I am trying to copy my blackberry assets folder to the SD card using the Input/Output stream however I cannot seem to get this to work, can some please advice what i am doing wrong:

	String[] resourseFileNames = {"file1","file2"."file3"};
	final int length = resourseFileNames.length;
	String currentProcessingResourceName;
	for(int i=0; i<length; i++)
	{	
		currentProcessingResourceName = resourseFileNames[i];
		conn = (FileConnection) Connector.open( "file:///store/home/user/sample/www",
		Connector.READ_WRITE );
		InputStream in = new FileInputStream(currentProcessingResourceName);
		OutputStream out = new OutputStream("file:///SDCard/myAppName/www");
		
		 // Copy the bits from instream to outstream
		byte[] buf = new byte[1024];
		int len;
		while ((len = in.read(buf)) > 0) {
			out.write(buf, 0, len);
		}
		in.close();
		out.close();
	}

I am using phonegap of that makes any difference. Thanks.