/*
 *  Copyright (C) 2010 reuillon
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openmole.core.file;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.openmole.core.model.execution.batch.IAccessToken;

import org.openmole.core.model.file.IURIFile;

public class GZURIFile extends URIFile {

    public GZURIFile(IURIFile file) {
        super(file);
    }

    @Override
    public InputStream openInputStream(IAccessToken token) throws IOException, InterruptedException {
        Logger.getLogger(GZURIFile.class.getName()).log(Level.FINE, "Opening gz input stream for {0}", getLocationString());
        return new GZIPInputStream(super.openInputStream(token));
    }

    @Override
    public OutputStream openOutputStream(IAccessToken token) throws IOException, InterruptedException {
        Logger.getLogger(GZURIFile.class.getName()).log(Level.FINE, "Opening gz output stream for {0}", getLocationString());
        return new GZIPOutputStream(super.openOutputStream(token));
    }
}

/*
 *  Copyright (C) 2010 reuillon
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openmole.core.file;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import org.openmole.core.model.execution.batch.IAccessToken;

import org.openmole.core.model.file.IURIFile;

public class GZURIFile extends URIFile {

    public GZURIFile(IURIFile file) {
        super(file);
    }

    @Override
    public InputStream openInputStream(IAccessToken token) throws IOException, InterruptedException {
        return new GZIPInputStream(super.openInputStream(token));
    }

    @Override
    public OutputStream openOutputStream(IAccessToken token) throws IOException, InterruptedException {
        return new GZIPOutputStream(super.openOutputStream(token));
    }
}

Remove log.