Merge branch 'master' of git://github.com/phonegap/phonegap-android

This commit is contained in:
macdonst 2011-07-11 23:30:41 -04:00
commit 37b9cc47bd
2 changed files with 0 additions and 27 deletions

View File

@ -92,10 +92,6 @@ FileMgr.prototype.getFreeDiskSpace = function(successCallback, errorCallback) {
return PhoneGap.exec(successCallback, errorCallback, "File", "getFreeDiskSpace", []);
};
FileMgr.prototype.writeAsText = function(fileName, data, append, successCallback, errorCallback) {
PhoneGap.exec(successCallback, errorCallback, "File", "writeAsText", [fileName, data, append]);
};
FileMgr.prototype.write = function(fileName, data, position, successCallback, errorCallback) {
PhoneGap.exec(successCallback, errorCallback, "File", "write", [fileName, data, position]);
};

View File

@ -104,9 +104,6 @@ public class FileUtils extends Plugin {
else if (action.equals("readAsDataURL")) {
String s = this.readAsDataURL(args.getString(0));
return new PluginResult(status, s);
}
else if (action.equals("writeAsText")) {
this.writeAsText(args.getString(0), args.getString(1), args.getBoolean(2));
}
else if (action.equals("write")) {
long fileSize = this.write(args.getString(0), args.getString(1), args.getInt(2));
@ -914,26 +911,6 @@ public class FileUtils extends Plugin {
return map.getMimeTypeFromExtension(map.getFileExtensionFromUrl(filename));
}
/**
* Write contents of file.
*
* @param filename The name of the file.
* @param data The contents of the file.
* @param append T=append, F=overwrite
* @throws FileNotFoundException, IOException
*/
public void writeAsText(String filename, String data, boolean append) throws FileNotFoundException, IOException {
String FilePath= filename;
byte [] rawData = data.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(rawData);
FileOutputStream out= new FileOutputStream(FilePath, append);
byte buff[] = new byte[rawData.length];
in.read(buff, 0, buff.length);
out.write(buff, 0, rawData.length);
out.flush();
out.close();
}
/**
* Write contents of file.
*