/*
 *  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());
    }

    @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());
    }
}

@@ -1458,32 +1458,37 @@
 openInputStream(
+token
 ));%0A    %7D%0A%0A    @
@@ -1785,16 +1785,21 @@
 tStream(
+token
 ));%0A    

Fix bug in GZURIFile.