*) Replaced System.err.println() by logging function. Left System.err.println()s as comments to be able to quickly revert changes since gzip is an application with it's own main method and Orbiter maybe wants to keep it this way.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4505 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 17 years ago
parent 677ee2ea04
commit 652086159a

@ -53,8 +53,12 @@ import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import de.anomic.server.logging.serverLog;
public class gzip {
private static serverLog logger = new serverLog("GZIP");
public static void gzipFile(String inFile, String outFile) {
try {
InputStream fin = new FileInputStream(inFile);
@ -63,9 +67,11 @@ public class gzip {
fin.close();
fout.close();
} catch (FileNotFoundException e) {
System.err.println("ERROR: file '" + inFile + "' not found");
//System.err.println("ERROR: file '" + inFile + "' not found");
logger.logWarning("ERROR: file '" + inFile + "' not found", e);
} catch (IOException e) {
System.err.println("ERROR: IO trouble");
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
}
}
@ -77,9 +83,11 @@ public class gzip {
fin.close();
fout.close();
} catch (FileNotFoundException e) {
System.err.println("ERROR: file '" + inFile + "' not found");
//System.err.println("ERROR: file '" + inFile + "' not found");
logger.logWarning("ERROR: file '" + inFile + "' not found", e);
} catch (IOException e) {
System.err.println("ERROR: IO trouble");
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
}
}
@ -93,7 +101,8 @@ public class gzip {
fout.close();
return baos.toByteArray();
} catch (IOException e) {
System.err.println("ERROR: IO trouble");
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
return null;
}
}
@ -107,7 +116,8 @@ public class gzip {
fout.close();
return new String(fout.toByteArray(), "UTF-8");
} catch (IOException e) {
System.err.println("ERROR: IO trouble");
//System.err.println("ERROR: IO trouble ");
logger.logWarning("ERROR: IO trouble ",e);
return null;
}
}

Loading…
Cancel
Save