vmfilesystemapi.java

来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 103 行

JAVA
103
字号
/*
 * $Id: VMFileSystemAPI.java,v 1.1 2003/11/25 11:41:56 epr Exp $
 */
package java.io;

/**
 * The implementation of this interface is used to connect the java.io package with the JNode
 * filesystem services.
 * 
 * @author epr
 */
public interface VMFileSystemAPI {

	/**
	 * Does a given file exist?
	 */
	public boolean fileExists(File file);

	/**
	 * Is the given File a plain file?
	 */
	public boolean isFile(File file);

	/**
	 * Is the given File a directory?
	 */
	public boolean isDirectory(File file);

	/**
	 * Can the given file be read?
	 * 
	 * @param file
	 */
	public boolean canRead(File file);

	/**
	 * Can the given file be written to?
	 * 
	 * @param file
	 */
	public boolean canWrite(File file);

	/**
	 * Gets the length in bytes of the given file or 0 if the file does not exist.
	 * 
	 * @param file
	 */
	public long getLength(File file);

	/**
	 * Gets the last modification date of the given file.
	 * 
	 * @param file
	 */
	public long getLastModified(File file);

	/**
	 * Sets the last modification date of the given file.
	 * 
	 * @param file
	 */
	public void setLastModified(File file, long time) throws IOException;

	/**
	 * Mark the given file as readonly.
	 * 
	 * @param file
	 * @throws IOException
	 */
	public void setReadOnly(File file) throws IOException;

	/**
	 * Delete the given file.
	 * 
	 * @param file
	 * @throws IOException
	 */
	public void delete(File file) throws IOException;

	/**
	 * This method returns an array of filesystem roots.
	 */
	public File[] getRoots();

	/**
	 * Gets an array of names of all entries of the given directory. All names are relative to the
	 * given directory.
	 * 
	 * @param directory
	 * @param filter
	 */
	public String[] list(File directory, FilenameFilter filter) throws IOException;

	/**
	 * Open a given file
	 * 
	 * @param file
	 * @throws IOException
	 */
	public VMFileHandle open(File file, VMOpenMode mode) throws IOException;

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?