Out with commons-io.

This commit is contained in:
Michael Bayne
2009-07-12 21:36:25 +00:00
parent 04067d73ef
commit a31171c575
7 changed files with 12 additions and 16 deletions
-1
View File
@@ -11,7 +11,6 @@
-injars dist/lib/samskivert.jar(
com/samskivert/Log.class,**/io/**,**/swing/**,**/net/**,**/text/**,**/util/**)
-injars dist/lib/commons-codec.jar(!META-INF/*)
-injars dist/lib/commons-io.jar(!META-INF/*)
-injars dist/lib/snark.jar(!META-INF/*)
-dontskipnonpubliclibraryclasses
-1
View File
@@ -4,7 +4,6 @@
<fileset dir="${libs.dir}" id="getdown.libs">
<include name="ant.jar"/>
<include name="commons-codec.jar"/>
<include name="commons-io.jar"/>
<include name="proguard.jar"/>
<include name="retroweaver-all-1.2.2.jar"/>
<include name="retroweaver-rt-1.2.2.jar"/>
@@ -23,6 +23,10 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.threerings.getdown.data;
import java.io.FileInputStream;
import com.samskivert.io.StreamUtil;
import static com.threerings.getdown.Log.log;
import java.awt.Color;
@@ -63,7 +67,6 @@ import java.util.regex.Pattern;
import javax.swing.JApplet;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import com.samskivert.io.StreamUtil;
import com.samskivert.text.MessageUtil;
@@ -1182,7 +1185,7 @@ public class Application
FileReader reader = null;
try {
reader = new FileReader(signatureFile);
signature = IOUtils.toByteArray(reader, "utf8");
signature = StreamUtil.toByteArray(new FileInputStream(signatureFile));
} finally {
StreamUtil.close(reader);
signatureFile.delete(); // delete the file regardless
@@ -1267,7 +1270,7 @@ public class Application
try {
fin = targetURL.openStream();
fout = new FileOutputStream(target);
IOUtils.copy(fin, fout);
StreamUtil.copy(fin, fout);
} finally {
StreamUtil.close(fin);
StreamUtil.close(fout);
@@ -40,7 +40,6 @@ import java.util.zip.ZipEntry;
import java.security.MessageDigest;
import com.sun.javaws.jardiff.JarDiff;
import org.apache.commons.io.IOUtils;
import com.samskivert.io.StreamUtil;
@@ -243,7 +242,7 @@ public class Differ
{
FileInputStream fin = null;
try {
IOUtils.copy(fin = new FileInputStream(file), jout);
StreamUtil.copy(fin = new FileInputStream(file), jout);
} finally {
StreamUtil.close(fin);
}
@@ -33,7 +33,6 @@ import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
import com.samskivert.io.StreamUtil;
import org.apache.commons.io.IOUtils;
import com.threerings.getdown.util.FileUtil;
import com.threerings.getdown.util.ProgressObserver;
@@ -166,7 +165,7 @@ public class Patcher
InputStream in = null;
FileOutputStream fout = null;
try {
IOUtils.copy(in = file.getInputStream(entry), fout = new FileOutputStream(patch));
StreamUtil.copy(in = file.getInputStream(entry), fout = new FileOutputStream(patch));
StreamUtil.close(fout);
fout = null;
@@ -30,8 +30,6 @@ import java.io.IOException;
import com.samskivert.io.StreamUtil;
import org.apache.commons.io.IOUtils;
import static com.threerings.getdown.Log.log;
/**
@@ -78,7 +76,7 @@ public class FileUtil
try {
fin = new FileInputStream(source);
fout = new FileOutputStream(dest);
IOUtils.copy(fin, fout);
StreamUtil.copy(fin, fout);
if (!source.delete()) {
log.warning("Failed to delete " + source +
" after brute force copy to " + dest + ".");
@@ -30,8 +30,7 @@ import java.io.IOException;
import java.io.PrintStream;
import java.util.logging.Level;
import org.apache.commons.io.IOUtils;
import com.samskivert.io.StreamUtil;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.StringUtil;
@@ -176,7 +175,7 @@ public class LaunchUtil
try {
// copy the moved file back to getdown-dop-new.jar so that we don't end up
// downloading another copy next time
IOUtils.copy(new FileInputStream(curgd), new FileOutputStream(newgd));
StreamUtil.copy(new FileInputStream(curgd), new FileOutputStream(newgd));
} catch (IOException e) {
log.warning("Error copying updated Getdown back: " + e);
}
@@ -193,7 +192,7 @@ public class LaunchUtil
// that didn't work, let's try copying it
log.info("Attempting to upgrade by copying over " + curgd + "...");
try {
IOUtils.copy(new FileInputStream(newgd), new FileOutputStream(curgd));
StreamUtil.copy(new FileInputStream(newgd), new FileOutputStream(curgd));
} catch (IOException ioe) {
log.warning("Mayday! Brute force copy method also failed.", ioe);
}