org.jwall.apache.httpd.service.FileSystem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apache-config Show documentation
Show all versions of apache-config Show documentation
A Java library for reading Apache httpd configuration files
The newest version!
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright (C) 2010-2014 Christian Bockermann
*
* This file is part of the jwall.org apache-config library. The apache-config library is
* a parsing library to handle Apache HTTPD configuration files.
*
* More information and documentation for the jwall-tools can be found at
*
* http://www.jwall.org/apache-config
*
* 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 .
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package org.jwall.apache.httpd.service;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
/**
*
* This interface defines an abstract file system layer.
*
*
* @author Christian Bockermann <[email protected]>
*
*/
public interface FileSystem {
public final static int FS_FILE_CREATED = 0;
public final static int FS_FILE_DELETED = 1;
public final static int FS_FILE_CHANGED = 2;
public String getAbsolutePath( File file );
public boolean exists( File file );
public boolean canRead( File file );
public File[] listFiles( File directory );
public boolean delete( File file ) throws IOException;
public byte[] get( File file ) throws IOException;
public void put( File file, byte[] content ) throws IOException;
public InputStream openInputStream( File file ) throws IOException;
public OutputStream openOutputStream( File file ) throws IOException;
/**
* Create a copy of the specified within the given destination file system.
* The file's path is used as the destination within the target fs.
*
* @param file
* @param fs
* @throws IOException
*/
public void copy( File file, FileSystem fs ) throws IOException;
public void copy( File file, FileSystem targetFs, File targetFile ) throws IOException;
public boolean isDirectory( File file );
public boolean createDirectory( File file ) throws IOException;
public boolean isSymlink( File file );
public File resolveSymlink( File symlink ) throws IOException;
public String readSymlink( File symlink ) throws IOException;
public void createSymlink( String path, File name ) throws IOException;
/**
* Computes the MD5 checksum of the given file.
*
* @param file
* @return
* @throws IOException
*/
public String md5( File file ) throws IOException;
/**
* Returns a URL which uniquely identifies the file and the file-system. Usually this
* URL contains a schema identifying the file-system implementation, the host on which
* the file system resides and the path of the file.
*
* @param file
* @return
*/
public URL getURL( File file );
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy