diff --git a/framework/src/com/phonegap/FileUtils.java b/framework/src/com/phonegap/FileUtils.java index 00aa9ce3..5f948566 100755 --- a/framework/src/com/phonegap/FileUtils.java +++ b/framework/src/com/phonegap/FileUtils.java @@ -531,7 +531,7 @@ public class FileUtils extends Plugin { * @throws NoModificationAllowedException * @throws InvalidModificationException */ - private JSONObject moveDirectory(File srcDir, File destinationDir) throws JSONException, FileExistsException, NoModificationAllowedException, InvalidModificationException { + private JSONObject moveDirectory(File srcDir, File destinationDir) throws JSONException, InvalidModificationException { // Renaming a file to an existing directory should fail if (destinationDir.exists() && destinationDir.isFile()) { throw new InvalidModificationException("Can't rename a file to a directory"); diff --git a/framework/src/com/phonegap/HttpHandler.java b/framework/src/com/phonegap/HttpHandler.java index 156d5a2c..78b8df50 100755 --- a/framework/src/com/phonegap/HttpHandler.java +++ b/framework/src/com/phonegap/HttpHandler.java @@ -20,6 +20,7 @@ package com.phonegap; import java.io.EOFException; import java.io.FileOutputStream; +import java.io.IOException; import java.io.InputStream; import org.apache.http.HttpEntity; @@ -56,27 +57,25 @@ public class HttpHandler { return entity; } - private void writeToDisk(HttpEntity entity, String file) throws EOFException + private void writeToDisk(HttpEntity entity, String file) throws IllegalStateException, IOException /** * writes a HTTP entity to the specified filename and location on disk */ { int i=0; String FilePath="/sdcard/" + file; - try { - InputStream in = entity.getContent(); - byte buff[] = new byte[1024]; - FileOutputStream out= - new FileOutputStream(FilePath); - do { - int numread = in.read(buff); - if (numread <= 0) - break; - out.write(buff, 0, numread); - i++; - } while (true); - out.flush(); - out.close(); - } catch (Exception e) { e.printStackTrace(); } + InputStream in = entity.getContent(); + byte buff[] = new byte[1024]; + FileOutputStream out= + new FileOutputStream(FilePath); + do { + int numread = in.read(buff); + if (numread <= 0) + break; + out.write(buff, 0, numread); + i++; + } while (true); + out.flush(); + out.close(); } }