
de.schlichtherle.io.AbstractArchiveDetector Maven / Gradle / Ivy
/*
* Copyright (C) 2006-2010 Schlichtherle IT Services
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.schlichtherle.io;
import java.io.FileNotFoundException;
import java.net.URI;
/**
* Implements the {@link FileFactory} part of the {@link ArchiveDetector}
* interface.
*
* @author Christian Schlichtherle
* @version $Id: AbstractArchiveDetector.java c86df83eaddc 2011/01/19 13:52:55 christian $
* @since TrueZIP 6.0
*/
public abstract class AbstractArchiveDetector implements ArchiveDetector {
public File createFile(java.io.File template) {
return new File(template, this);
}
/**
* @deprecated This factory method is not intented for public use
* - do not use it!
*/
public File createFile(java.io.File delegate, File innerArchive) {
return new File(delegate, innerArchive, this);
}
/**
* @deprecated This factory method is not intented for public use
* and is broken by design - do not use it!
*/
public File createFile(
File template,
java.io.File delegate,
File enclArchive) {
return new File(template, delegate, enclArchive);
}
public File createFile(java.io.File parent, String child) {
return new File(parent, child, this);
}
public File createFile(String pathName) {
return new File(pathName, this);
}
public File createFile(String parent, String child) {
return new File(parent, child, this);
}
public File createFile(URI uri) {
return new File(uri, this);
}
public FileInputStream createFileInputStream(java.io.File file)
throws FileNotFoundException {
return new FileInputStream(file);
}
public FileOutputStream createFileOutputStream(
java.io.File file,
boolean append)
throws FileNotFoundException {
return new FileOutputStream(file, append);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy