From: <ga...@us...> - 2009-02-28 19:22:07
|
Revision: 5074 http://jnode.svn.sourceforge.net/jnode/?rev=5074&view=rev Author: galatnm Date: 2009-02-28 19:22:01 +0000 (Sat, 28 Feb 2009) Log Message: ----------- Correct and improve javadocs. Modified Paths: -------------- trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java trunk/fs/src/fs/org/jnode/fs/FSDirectory.java trunk/fs/src/fs/org/jnode/fs/FSFile.java trunk/fs/src/fs/org/jnode/fs/FileSystemType.java Modified: trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java 2009-02-28 18:59:06 UTC (rev 5073) +++ trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java 2009-02-28 19:22:01 UTC (rev 5074) @@ -24,7 +24,7 @@ import java.security.Principal; /** - * This interface described the accessright for a given FSEntry. + * <tt>FSAccessRights</tt> interface described the access rights for a given {@link FSEntry}. * * @author epr */ @@ -33,19 +33,60 @@ /** * Gets the owner of the entry. * - * @throws IOException + * @return {@link Principal} represent owner of the entry. + * + * @throws IOException if error occurs during retrieve of the owner. */ public Principal getOwner() throws IOException; + /** + * Returns <tt>true</tt> if read is allow for the related entry. + * + * @return <tt>true</tt> if read is allow for the related entry. + */ public boolean canRead(); + /** + * Returns <tt>true</tt> if write is allow for the related entry. + * + * @return <tt>true</tt> if write is allow for the related entry. + */ public boolean canWrite(); + /** + * Returns <tt>true</tt> if execution is allow for the related entry. + * + * @return <tt>true</tt> if execution is allow for the related entry. + */ public boolean canExecute(); + /** + * Set related entry as readable. This right can be limited to the owner. + * + * @param enable <tt>true</tt> to allow right to read the related entry. + * @param owneronly <tt>true</tt> to limit the read to the owner. + * + * @return <tt>true</tt> if read is allowed. + */ public boolean setReadable(boolean enable, boolean owneronly); + /** + * Set related entry as writable. This right can be limited to the owner. + * + * @param enable <tt>true</tt> to allow right to write the related entry. + * @param owneronly <tt>true</tt> to limit the write to the owner. + * + * @return <tt>true</tt> if write is allowed. + */ public boolean setWritable(boolean enable, boolean owneronly); + /** + * Set related entry as executable. This right can be limited to the owner. + * + * @param enable <tt>true</tt> to allow right to execute the related entry. + * @param owneronly <tt>true</tt> to limit the read to the owner. + * + * @return <tt>true</tt> if execution is allowed. + */ public boolean setExecutable(boolean enable, boolean owneronly); } Modified: trunk/fs/src/fs/org/jnode/fs/FSDirectory.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSDirectory.java 2009-02-28 18:59:06 UTC (rev 5073) +++ trunk/fs/src/fs/org/jnode/fs/FSDirectory.java 2009-02-28 19:22:01 UTC (rev 5074) @@ -24,52 +24,68 @@ import java.util.Iterator; /** + * <tt>FSDirectory</tt> interface provide methods related to directory operations in a file system. + * * @author epr */ public interface FSDirectory extends FSObject { /** * Gets an iterator used to iterate over all the entries of this directory. - * All elements returned by the iterator must be instanceof FSEntry. + * All elements returned by the iterator must be instance of FSEntry. + * + * @return an iterator over the entries of this directory. + * + * @throws IOException if error occurs during iteration. */ public Iterator<? extends FSEntry> iterator() throws IOException; /** * Gets the entry with the given name. * - * @param name - * @throws IOException + * @param name identify the requested entry. + * + * @return {@link FSEntry} corresponding to the name passed as parameter. + * + * @throws IOException if no entry exists with this name. */ public FSEntry getEntry(String name) throws IOException; /** * Add a new file with a given name to this directory. * - * @param name - * @throws IOException + * @param name identify the new file. + * + * @return {@link FSEntry} corresponding to new created file. + * + * @throws IOException if a directory already exists with this name */ public FSEntry addFile(String name) throws IOException; /** * Add a new (sub-)directory with a given name to this directory. * - * @param name - * @throws IOException + * @param name identify the new directory. + * + * @return {@link FSEntry} corresponding to new created directory. + * + * @throws IOException if a directory already exists with this name. */ public FSEntry addDirectory(String name) throws IOException; /** * Remove the entry with the given name from this directory. * - * @param name - * @throws IOException + * @param name identify the entry that should be remove. + * + * @throws IOException if there is no entry with this name. */ public void remove(String name) throws IOException; /** - * Save all dirty (unsaved) data to the device + * Save all unsaved data to the device. * - * @throws IOException + * @throws IOException if error occurs during write of the data. */ public void flush() throws IOException; Modified: trunk/fs/src/fs/org/jnode/fs/FSFile.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FSFile.java 2009-02-28 18:59:06 UTC (rev 5073) +++ trunk/fs/src/fs/org/jnode/fs/FSFile.java 2009-02-28 19:22:01 UTC (rev 5074) @@ -24,7 +24,7 @@ import java.nio.ByteBuffer; /** - * A FSFile is a representation of a single block of bytes on a filesystem. It + * A FSFile is a representation of a single block of bytes on a file system. It * is comparable to an inode in Unix. * * An FSFile does not have any knowledge of who is using this file. It is also @@ -36,46 +36,47 @@ public interface FSFile extends FSObject { /** - * Gets the length (in bytes) of this file + * Gets the length in bytes of this file. * - * @return long + * @return the number of byte in this file. */ public long getLength(); /** - * Sets the length of this file. + * Sets the length in bytes of this file. * - * @param length - * @throws IOException + * @param length the number of byte in this file. + * + * @throws IOException if error occurs during set of file's length. */ public void setLength(long length) throws IOException; /** - * Read <code>len</code> bytes from the given position. The read data is - * read fom this file starting at offset <code>fileOffset</code> and - * stored in <code>dest</code> starting at offset <code>ofs</code>. + * Read from this file starting at offset <code>fileOffset</code> and + * stored in <code>dest</code> byte buffer. * - * @param fileOffset - * @param dest - * @throws IOException + * @param fileOffset position in the file where the read begins. + * @param dest {@link ByteBuffer} receive contains of the file. + * + * @throws IOException if error occurs during reading of the data. */ public void read(long fileOffset, ByteBuffer dest) throws IOException; /** - * Write <code>len</code> bytes to the given position. The data is read - * from <code>src</code> starting at offset <code>ofs</code> and written - * to this file starting at offset <code>fileOffset</code>. + * Read bytes from <code>src</code> byte buffer and written + * to this file starting at offset <code>fileOffset</code> * - * @param fileOffset - * @param src - * @throws IOException + * @param fileOffset position in the file where datas are written. + * @param src {@link ByteBuffer} contains datas to write. + * + * @throws IOException if error occurs during write of the datas. */ public void write(long fileOffset, ByteBuffer src) throws IOException; /** - * Flush any cached data to the disk. + * Save all unsaved datas from the cache to the device. * - * @throws IOException + * @throws IOException if error occurs during flush of datas. */ public void flush() throws IOException; } Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemType.java =================================================================== --- trunk/fs/src/fs/org/jnode/fs/FileSystemType.java 2009-02-28 18:59:06 UTC (rev 5073) +++ trunk/fs/src/fs/org/jnode/fs/FileSystemType.java 2009-02-28 19:22:01 UTC (rev 5074) @@ -17,28 +17,37 @@ * along with this library; If not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - + package org.jnode.fs; import org.jnode.driver.Device; /** - * Descriptor and entry point for a class of filesystems. + * Descriptor and entry point for a class of file systems. * + * @param <T> {@link FileSystem} + * * @author epr + * */ public interface FileSystemType<T extends FileSystem<?>> { /** * Gets the unique name of this file system type. + * + * @return name of the file system. */ public String getName(); /** - * Create a filesystem from a given device. + * Create a file system from a given device. * - * @param device - * @param readOnly + * @param device {@link Device} contains the file system. + * @param readOnly set to <tt>true</tt> if the new file system must be read + * only. + * @return a file system + * @throws FileSystemException if error occurs during creation of the new + * file system. */ public T create(Device device, boolean readOnly) throws FileSystemException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |