|
From: <cr...@us...> - 2008-06-05 14:26:20
|
Revision: 4201
http://jnode.svn.sourceforge.net/jnode/?rev=4201&view=rev
Author: crawley
Date: 2008-06-05 07:26:18 -0700 (Thu, 05 Jun 2008)
Log Message:
-----------
Fixes for Java compilation warnings and CheckStyle warnings
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/fs/BlockDeviceFileSystemType.java
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/FSEntry.java
trunk/fs/src/fs/org/jnode/fs/FSEntryTableIgnoreCase.java
trunk/fs/src/fs/org/jnode/fs/FSFile.java
trunk/fs/src/fs/org/jnode/fs/FSObject.java
trunk/fs/src/fs/org/jnode/fs/FileSystem.java
trunk/fs/src/fs/org/jnode/fs/FileSystemException.java
trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java
trunk/fs/src/fs/org/jnode/fs/FileSystemType.java
trunk/fs/src/fs/org/jnode/fs/Formatter.java
trunk/fs/src/fs/org/jnode/fs/ReadOnlyFileSystemException.java
trunk/fs/src/fs/org/jnode/fs/command/AbstractFormatCommand.java
trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java
trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java
trunk/fs/src/fs/org/jnode/fs/command/DFCommand.java
trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java
trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java
trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java
trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java
trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java
trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java
trunk/fs/src/fs/org/jnode/fs/command/PwdCommand.java
trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java
trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFileSystemType.java
trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java
trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Driver.java
trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java
trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2FileSystemType.java
Modified: trunk/fs/src/fs/org/jnode/fs/BlockDeviceFileSystemType.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/BlockDeviceFileSystemType.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/BlockDeviceFileSystemType.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -26,18 +26,17 @@
/**
* Specific kind of FileSystemType for block devices
- *
+ *
* @author epr
*/
public interface BlockDeviceFileSystemType<T extends FileSystem<?>> extends FileSystemType<T> {
- /**
- * Can this file system type be used on the given first sector of a
- * blockdevice?
- *
- * @param pte
- * The partition table entry, if any. If null, there is no
- * partition table entry.
- * @param firstSector
- */
- public boolean supports(PartitionTableEntry pte, byte[] firstSector, FSBlockDeviceAPI devApi);
+ /**
+ * Can this file system type be used on the given first sector of a
+ * blockdevice?
+ *
+ * @param pte The partition table entry, if any. If null, there is no
+ * partition table entry.
+ * @param firstSector
+ */
+ public boolean supports(PartitionTableEntry pte, byte[] firstSector, FSBlockDeviceAPI devApi);
}
Modified: trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSAccessRights.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -30,23 +30,23 @@
* @author epr
*/
public interface FSAccessRights extends FSObject {
-
- /**
- * Gets the owner of the entry.
- * @throws IOException
- */
- public Principal getOwner()
- throws IOException;
- public boolean canRead();
+ /**
+ * Gets the owner of the entry.
+ *
+ * @throws IOException
+ */
+ public Principal getOwner() throws IOException;
- public boolean canWrite();
+ public boolean canRead();
- public boolean canExecute();
+ public boolean canWrite();
- public boolean setReadable(boolean enable, boolean owneronly);
+ public boolean canExecute();
- public boolean setWritable(boolean enable, boolean owneronly);
+ public boolean setReadable(boolean enable, boolean owneronly);
- public boolean setExecutable(boolean enable, boolean owneronly);
+ public boolean setWritable(boolean enable, boolean owneronly);
+
+ 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 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSDirectory.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -28,51 +28,50 @@
* @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.
- */
- public Iterator<? extends FSEntry> iterator()
- throws IOException;
-
- /**
- * Gets the entry with the given name.
- * @param name
- * @throws IOException
- */
- public FSEntry getEntry(String name)
- throws IOException;
-
- /**
- * Add a new file with a given name to this directory.
- * @param name
- * @throws IOException
- */
- public FSEntry addFile(String name)
- throws IOException;
- /**
- * Add a new (sub-)directory with a given name to this directory.
- * @param name
- * @throws IOException
- */
- public FSEntry addDirectory(String name)
- throws IOException;
-
- /**
- * Remove the entry with the given name from this directory.
- * @param name
- * @throws IOException
- */
- public void remove(String name)
- throws IOException;
-
- /**
- * Save all dirty (unsaved) data to the device
- * @throws IOException
- */
- public void flush() throws IOException;
+ /**
+ * Gets an iterator used to iterate over all the entries of this directory.
+ * All elements returned by the iterator must be instanceof FSEntry.
+ */
+ public Iterator<? extends FSEntry> iterator() throws IOException;
+ /**
+ * Gets the entry with the given name.
+ *
+ * @param name
+ * @throws IOException
+ */
+ public FSEntry getEntry(String name) throws IOException;
+
+ /**
+ * Add a new file with a given name to this directory.
+ *
+ * @param name
+ * @throws IOException
+ */
+ public FSEntry addFile(String name) throws IOException;
+
+ /**
+ * Add a new (sub-)directory with a given name to this directory.
+ *
+ * @param name
+ * @throws IOException
+ */
+ public FSEntry addDirectory(String name) throws IOException;
+
+ /**
+ * Remove the entry with the given name from this directory.
+ *
+ * @param name
+ * @throws IOException
+ */
+ public void remove(String name) throws IOException;
+
+ /**
+ * Save all dirty (unsaved) data to the device
+ *
+ * @throws IOException
+ */
+ public void flush() throws IOException;
+
}
Modified: trunk/fs/src/fs/org/jnode/fs/FSEntry.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FSEntry.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSEntry.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -19,6 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
package org.jnode.fs;
import java.io.IOException;
@@ -28,80 +29,79 @@
*/
/**
* Entry of an FSDirectory.
+ *
* @author epr
*/
public interface FSEntry extends FSObject {
-
- /**
- * Gets the name of this entry.
- */
- public String getName();
-
- /**
- * Gets the directory this entry is a part of.
- */
- public FSDirectory getParent();
-
- /**
- * Gets the last modification time of this entry.
- * @throws IOException
- */
- public long getLastModified()
- throws IOException;
+ /**
+ * Gets the name of this entry.
+ */
+ public String getName();
- /**
- * Is this entry refering to a file?
- */
- public boolean isFile();
+ /**
+ * Gets the directory this entry is a part of.
+ */
+ public FSDirectory getParent();
- /**
- * Is this entry refering to a (sub-)directory?
- */
- public boolean isDirectory();
+ /**
+ * Gets the last modification time of this entry.
+ *
+ * @throws IOException
+ */
- /**
- * Sets the name of this entry.
- */
- public void setName(String newName)
- throws IOException;
-
- /**
- * Gets the last modification time of this entry.
- * @throws IOException
- */
- public void setLastModified(long lastModified)
- throws IOException;
-
- /**
- * Gets the file this entry refers to. This method can only be called
- * if <code>isFile</code> returns true.
- *
- * @return The file described by this entry
- */
- public FSFile getFile()
- throws IOException;
+ public long getLastModified() throws IOException;
- /**
- * Gets the directory this entry refers to. This method can only be called
- * if <code>isDirectory</code> returns true.
- *
- * @return The directory described by this entry
- */
- public FSDirectory getDirectory()
- throws IOException;
-
- /**
- * Gets the accessrights for this entry.
- * @throws IOException
- */
- public FSAccessRights getAccessRights()
- throws IOException;
-
- /**
- * Indicate if the entry has been modified in memory (ie need to be saved)
- * @return true if the entry need to be saved
- * @throws IOException
- */
- public boolean isDirty() throws IOException;
+ /**
+ * Is this entry refering to a file?
+ */
+ public boolean isFile();
+
+ /**
+ * Is this entry refering to a (sub-)directory?
+ */
+ public boolean isDirectory();
+
+ /**
+ * Sets the name of this entry.
+ */
+ public void setName(String newName) throws IOException;
+
+ /**
+ * Gets the last modification time of this entry.
+ *
+ * @throws IOException
+ */
+ public void setLastModified(long lastModified) throws IOException;
+
+ /**
+ * Gets the file this entry refers to. This method can only be called if
+ * <code>isFile</code> returns true.
+ *
+ * @return The file described by this entry
+ */
+ public FSFile getFile() throws IOException;
+
+ /**
+ * Gets the directory this entry refers to. This method can only be called
+ * if <code>isDirectory</code> returns true.
+ *
+ * @return The directory described by this entry
+ */
+ public FSDirectory getDirectory() throws IOException;
+
+ /**
+ * Gets the accessrights for this entry.
+ *
+ * @throws IOException
+ */
+ public FSAccessRights getAccessRights() throws IOException;
+
+ /**
+ * Indicate if the entry has been modified in memory (ie need to be saved)
+ *
+ * @return true if the entry need to be saved
+ * @throws IOException
+ */
+ public boolean isDirty() throws IOException;
}
Modified: trunk/fs/src/fs/org/jnode/fs/FSEntryTableIgnoreCase.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FSEntryTableIgnoreCase.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSEntryTableIgnoreCase.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -23,32 +23,34 @@
import java.util.List;
-import org.jnode.fs.spi.*;
import org.jnode.fs.spi.AbstractFileSystem;
+import org.jnode.fs.spi.FSEntryTable;
/**
* A child class of FSEntryTable that ignore the case of entry names.
- *
+ *
* @author Fabien DUMINY
*/
public class FSEntryTableIgnoreCase extends FSEntryTable {
- /**
- * Construct a FSEntryTableIgnoreCase from a list of FSEntry
- * @param fs
- * @param entryList
- */
- public FSEntryTableIgnoreCase(AbstractFileSystem fs, List<FSEntry> entryList) {
- super(fs, entryList);
- }
-
- /**
- * To Ignore case, we convert all entry names to upper case
- */
- protected String normalizeName(String name)
- {
- if(name == null)
- return null;
-
- return name.toUpperCase();
- }
+
+ /**
+ * Construct a FSEntryTableIgnoreCase from a list of FSEntry
+ *
+ * @param fs
+ * @param entryList
+ */
+ public FSEntryTableIgnoreCase(AbstractFileSystem<?> fs, List<FSEntry> entryList) {
+ super(fs, entryList);
+ }
+
+ /**
+ * To Ignore case, we convert all entry names to upper case
+ */
+ protected String normalizeName(String name) {
+ if (name == null) {
+ return null;
+ }
+
+ return name.toUpperCase();
+ }
}
Modified: trunk/fs/src/fs/org/jnode/fs/FSFile.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FSFile.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSFile.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -25,57 +25,58 @@
import java.nio.ByteBuffer;
/**
- * A FSFile is a representation of a single block of bytes on a filesystem.
- * It is comparable to an inode in Unix.
+ * A FSFile is a representation of a single block of bytes on a filesystem. It
+ * is comparable to an inode in Unix.
*
- * An FSFile does not have any knownledge of who is using this file. It is also possible
- * that is system uses a single FSFile instances to create two inputstream's for
- * two different principals.
+ * An FSFile does not have any knowledge of who is using this file. It is also
+ * possible that the system uses a single FSFile instance to create two
+ * inputstream's for two different principals.
*
* @author epr
*/
public interface FSFile extends FSObject {
- /**
- * Gets the length (in bytes) of this file
- * @return long
- */
- public long getLength();
-
- /**
- * Sets the length of this file.
- * @param length
- * @throws IOException
- */
- public void setLength(long length)
- throws IOException;
+ /**
+ * Gets the length (in bytes) of this file
+ *
+ * @return long
+ */
+ public long getLength();
- /**
- * 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>.
- * @param fileOffset
- * @param dest
- * @throws IOException
- */
- 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>.
- * @param fileOffset
- * @param src
- * @throws IOException
- */
- public void write(long fileOffset, ByteBuffer src)
- throws IOException;
-
- /**
- * Flush any cached data to the disk.
- * @throws IOException
- */
- public void flush()
- throws IOException;
+ /**
+ * Sets the length of this file.
+ *
+ * @param length
+ * @throws IOException
+ */
+ 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>.
+ *
+ * @param fileOffset
+ * @param dest
+ * @throws IOException
+ */
+ 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>.
+ *
+ * @param fileOffset
+ * @param src
+ * @throws IOException
+ */
+ public void write(long fileOffset, ByteBuffer src) throws IOException;
+
+ /**
+ * Flush any cached data to the disk.
+ *
+ * @throws IOException
+ */
+ public void flush() throws IOException;
}
Modified: trunk/fs/src/fs/org/jnode/fs/FSObject.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FSObject.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FSObject.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -18,28 +18,28 @@
* 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;
/**
- * This interface is the base interface objects that are part of a FileSystem.
- *
+ * This interface is the base interface for objects that are part of a FileSystem.
+ *
* @author epr
*/
public interface FSObject {
-
- /**
- * Is this object still valid.
- *
- * An object is not valid anymore if it has been removed from the filesystem.
- * All invocations on methods (exception this method) of invalid objects
- * must throw an IOException.
- */
- public boolean isValid();
-
- /**
- * Gets the filesystem to which this object belongs.
- */
- public FileSystem getFileSystem();
+ /**
+ * Is this object still valid.
+ *
+ * An object is not valid anymore if it has been removed from the
+ * filesystem. All invocations on methods (exception this method) of invalid
+ * objects must throw an IOException.
+ */
+ public boolean isValid();
+
+ /**
+ * Gets the filesystem to which this object belongs.
+ */
+ public FileSystem<?> getFileSystem();
+
}
Modified: trunk/fs/src/fs/org/jnode/fs/FileSystem.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FileSystem.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FileSystem.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -30,7 +30,7 @@
*/
public interface FileSystem<T extends FSEntry> {
- public FileSystemType<? extends FileSystem<T>> getType();
+ public FileSystemType<? extends FileSystem<T>> getType();
/**
* Gets the device this FS driver operates on.
@@ -52,7 +52,7 @@
* Close this filesystem. After a close, all invocations of method of this
* filesystem or objects created by this filesystem will throw an
* IOException.
- *
+ *
* @throws IOException
*/
public void close() throws IOException;
@@ -62,9 +62,9 @@
*/
public boolean isClosed();
- public long getTotalSpace() throws IOException;
+ public long getTotalSpace() throws IOException;
- public long getFreeSpace() throws IOException;
+ public long getFreeSpace() throws IOException;
- public long getUsableSpace() throws IOException;
+ public long getUsableSpace() throws IOException;
}
Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemException.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FileSystemException.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FileSystemException.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -19,6 +19,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+
package org.jnode.fs;
/**
@@ -26,32 +27,32 @@
*/
public class FileSystemException extends Exception {
- /**
- *
- */
- public FileSystemException() {
- super();
- }
+ /**
+ *
+ */
+ public FileSystemException() {
+ super();
+ }
- /**
- * @param message
- * @param cause
- */
- public FileSystemException(String message, Throwable cause) {
- super(message, cause);
- }
+ /**
+ * @param message
+ * @param cause
+ */
+ public FileSystemException(String message, Throwable cause) {
+ super(message, cause);
+ }
- /**
- * @param cause
- */
- public FileSystemException(Throwable cause) {
- super(cause);
- }
+ /**
+ * @param cause
+ */
+ public FileSystemException(Throwable cause) {
+ super(cause);
+ }
- /**
- * @param s
- */
- public FileSystemException(String s) {
- super(s);
- }
+ /**
+ * @param s
+ */
+ public FileSystemException(String s) {
+ super(s);
+ }
}
Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FileSystemFullException.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -23,10 +23,9 @@
import java.io.IOException;
-public class FileSystemFullException extends IOException
-{
- public FileSystemFullException(String message)
- {
+public class FileSystemFullException extends IOException {
+
+ public FileSystemFullException(String message) {
super(message);
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/FileSystemType.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/FileSystemType.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/FileSystemType.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -25,21 +25,21 @@
/**
* Descriptor and entry point for a class of filesystems.
- *
+ *
* @author epr
*/
public interface FileSystemType<T extends FileSystem<?>> {
- /**
- * Gets the unique name of this file system type.
- */
- public String getName();
+ /**
+ * Gets the unique name of this file system type.
+ */
+ public String getName();
- /**
- * Create a filesystem from a given device.
- *
- * @param device
- * @param readOnly
- */
- public T create(Device device, boolean readOnly) throws FileSystemException;
+ /**
+ * Create a filesystem from a given device.
+ *
+ * @param device
+ * @param readOnly
+ */
+ public T create(Device device, boolean readOnly) throws FileSystemException;
}
Modified: trunk/fs/src/fs/org/jnode/fs/Formatter.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/Formatter.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/Formatter.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -1,39 +1,35 @@
package org.jnode.fs;
import org.jnode.driver.Device;
-import org.jnode.fs.ext2.Ext2FileSystemType;
/**
- *
+ *
* @author Fabien DUMINY (fduminy at jnode.org)
- *
+ *
* @param <T>
*/
-abstract public class Formatter<T extends FileSystem<?>> implements Cloneable {
- private final FileSystemType<T> type;
+public abstract class Formatter<T extends FileSystem<?>> implements Cloneable {
+ private final FileSystemType<T> type;
- protected Formatter(FileSystemType<T> type)
- {
- this.type = type;
- }
+ protected Formatter(FileSystemType<T> type) {
+ this.type = type;
+ }
/**
* Format the given device
- *
+ *
* @param device The device we want to format
* @return the newly created FileSystem
* @throws FileSystemException
*/
- abstract public T format(Device device) throws FileSystemException;
+ public abstract T format(Device device) throws FileSystemException;
- final public FileSystemType<T> getFileSystemType()
- {
- return type;
- }
+ public final FileSystemType<T> getFileSystemType() {
+ return type;
+ }
- @SuppressWarnings("unchecked")
- public Formatter<T> clone() throws CloneNotSupportedException
- {
- return (Formatter<T>) super.clone();
- }
+ @SuppressWarnings("unchecked")
+ public Formatter<T> clone() throws CloneNotSupportedException {
+ return (Formatter<T>) super.clone();
+ }
}
Modified: trunk/fs/src/fs/org/jnode/fs/ReadOnlyFileSystemException.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/ReadOnlyFileSystemException.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/ReadOnlyFileSystemException.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -29,25 +29,28 @@
* New exception allowing to handle cases where a FileSystem is mounted readOnly
*/
public class ReadOnlyFileSystemException extends IOException {
- /**
- * @param message
- * @param cause
- */
- public ReadOnlyFileSystemException(String message, Throwable cause) {
- super(message);
- initCause(cause);
- }
- /**
- * @param cause
- */
- public ReadOnlyFileSystemException(Throwable cause) {
- super();
- initCause(cause);
- }
- /**
- * @param message
- */
- public ReadOnlyFileSystemException(String message) {
- super(message);
- }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public ReadOnlyFileSystemException(String message, Throwable cause) {
+ super(message);
+ initCause(cause);
+ }
+
+ /**
+ * @param cause
+ */
+ public ReadOnlyFileSystemException(Throwable cause) {
+ super();
+ initCause(cause);
+ }
+
+ /**
+ * @param message
+ */
+ public ReadOnlyFileSystemException(String message) {
+ super(message);
+ }
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/AbstractFormatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/AbstractFormatCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/AbstractFormatCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -54,11 +54,10 @@
registerArguments(ARG_DEVICE);
}
- abstract protected Formatter<T> getFormatter();
+ protected abstract Formatter<T> getFormatter();
- final public void execute(CommandLine commandLine, InputStream in,
- PrintStream out, PrintStream err)
- throws FileSystemException, NameNotFoundException, DeviceNotFoundException, DriverException {
+ public final void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
+ throws FileSystemException, NameNotFoundException, DeviceNotFoundException, DriverException {
Device dev = ARG_DEVICE.getValue();
Formatter<T> formatter = getFormatter();
formatter.format(dev);
Modified: trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -69,8 +69,7 @@
}
public void execute(CommandLine commandLine, InputStream in,
- PrintStream out, PrintStream err)
- throws IOException {
+ PrintStream out, PrintStream err) throws IOException {
File[] files = ARG_FILE.getValues();
String[] urls = ARG_URL.getValues();
boolean ok = true;
@@ -82,14 +81,13 @@
is = url.openStream();
if (is == null) {
ok = false;
- }
- else {
+ } else {
process(is, out);
}
} catch (MalformedURLException ex) {
err.println("Malformed url '" + urlString + "': " + ex.getMessage());
} catch (IOException ex) {
- err.println("Can't fetch url '" + urlString + "': " + ex.getMessage());
+ err.println("Can't fetch url '" + urlString + "': " + ex.getMessage());
} finally {
if (is != null) {
try {
@@ -100,16 +98,14 @@
}
}
}
- }
- else if (files != null && files.length > 0) {
+ } else if (files != null && files.length > 0) {
for (File file : files) {
InputStream is = null;
try {
is = openFile(file, err);
if (is == null) {
ok = false;
- }
- else {
+ } else {
process(is, out);
}
} finally {
@@ -122,8 +118,7 @@
}
}
}
- }
- else {
+ } else {
process(in, out);
}
if (out.checkError()) {
@@ -163,14 +158,11 @@
// that the exception message is accurate and detailed!)
if (!file.exists()) {
err.println("File doesn't exist: '" + file + "'");
- }
- else if (!file.canRead()) {
+ } else if (!file.canRead()) {
err.println("File not readable: '" + file + "'");
- }
- else if (file.isDirectory()) {
+ } else if (file.isDirectory()) {
err.println("Can't 'cat' a directory: '" + file + "'");
- }
- else {
+ } else {
is = new FileInputStream(file);
}
return is;
Modified: trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/CdCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -18,7 +18,7 @@
* 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.command;
import java.io.File;
@@ -29,8 +29,7 @@
import org.jnode.shell.AbstractCommand;
import org.jnode.shell.CommandLine;
import org.jnode.shell.syntax.Argument;
-import org.jnode.shell.syntax.FileArgument;
-import org.jnode.test.AnnotationTest.A;
+import org.jnode.shell.syntax.FileArgument;
/**
* The CdCommand class changes the current directory as given by the "user.dir" property.
@@ -41,37 +40,37 @@
*/
public class CdCommand extends AbstractCommand {
- private final FileArgument ARG_DIR = new FileArgument(
- "directory", Argument.OPTIONAL, "the directory to change to");
+ private final FileArgument ARG_DIR = new FileArgument(
+ "directory", Argument.OPTIONAL, "the directory to change to");
- public CdCommand() {
+ public CdCommand() {
super("Change the current directory");
registerArguments(ARG_DIR);
}
-
- public static void main(String[] args) throws Exception {
- new CdCommand().execute(args);
- }
-
- public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
- throws IOException {
- File dir = ARG_DIR.getValue();
- if (dir == null) {
- // If no directory argument was given, change to the "user.home" directory.
- String home = System.getProperty("user.home");
- if (home == null || home.isEmpty()) {
- err.println("user.home is not set");
- exit(1);
- }
- dir = new File(home);
- }
- if (dir.exists() && dir.isDirectory()) {
- System.setProperty("user.dir", dir.getAbsoluteFile().getCanonicalPath());
- } else {
- err.println(dir + " is not a valid directory");
- exit(1);
- }
- }
+ public static void main(String[] args) throws Exception {
+ new CdCommand().execute(args);
+ }
+ public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
+ throws IOException {
+ File dir = ARG_DIR.getValue();
+
+ if (dir == null) {
+ // If no directory argument was given, change to the "user.home" directory.
+ String home = System.getProperty("user.home");
+ if (home == null || home.isEmpty()) {
+ err.println("user.home is not set");
+ exit(1);
+ }
+ dir = new File(home);
+ }
+ if (dir.exists() && dir.isDirectory()) {
+ System.setProperty("user.dir", dir.getAbsoluteFile().getCanonicalPath());
+ } else {
+ err.println(dir + " is not a valid directory");
+ exit(1);
+ }
+ }
+
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/CpCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -113,19 +113,15 @@
copyIntoDirectory(source, target);
}
}
- }
- else if (sources.length > 1) {
+ } else if (sources.length > 1) {
error("Multi-file copy requires the target to be a directory");
- }
- else {
+ } else {
File source = sources[0];
if (source.isDirectory()) {
error("Cannot copy a directory to a file");
- }
- else if (target.exists() && !target.isFile()) {
+ } else if (target.exists() && !target.isFile()) {
error("Cannot copy to a device");
- }
- else {
+ } else {
if (checkSafe(source, target)) {
copyToFile(source, target);
}
@@ -167,8 +163,7 @@
private void copyIntoDirectory(File source, File targetDir) throws IOException {
if (!targetDir.canWrite()) {
skip("directory '" + targetDir + "' is not writable");
- }
- else if (source.isDirectory()) {
+ } else if (source.isDirectory()) {
if (recursive) {
File newDir = new File(targetDir, source.getName());
if (!newDir.exists()) {
@@ -177,8 +172,7 @@
}
newDir.mkdir();
directoriesCreated++;
- }
- else if (!newDir.isDirectory()) {
+ } else if (!newDir.isDirectory()) {
if (mode == MODE_FORCE) {
if (verbose) {
out.println("Replacing file '" + newDir + "' with a directory");
@@ -186,8 +180,7 @@
newDir.delete();
newDir.mkdir();
directoriesCreated++;
- }
- else {
+ } else {
skip("not overwriting '" + newDir + "' with a directory");
return;
}
@@ -199,12 +192,10 @@
}
copyIntoDirectory(new File(source, name), newDir);
}
- }
- else {
+ } else {
skip("'" + source + "' is a directory");
}
- }
- else {
+ } else {
File newFile = new File(targetDir, source.getName());
copyToFile(source, newFile);
}
@@ -239,21 +230,18 @@
}
tout.write(buffer, 0, nosBytesRead);
}
- }
- finally {
+ } finally {
if (sin != null) {
try {
sin.close();
- }
- catch (IOException ex) {
+ } catch (IOException ex) {
// ignore
}
}
if (tout != null) {
try {
tout.close();
- }
- catch (IOException ex) {
+ } catch (IOException ex) {
// ignore
}
}
@@ -271,14 +259,11 @@
private boolean checkSource(File source) {
if (!source.exists()) {
return skip("'" + source + "' does not exist");
- }
- else if (!source.canRead()) {
+ } else if (!source.canRead()) {
return skip("'" + source + "' cannot be read");
- }
- else if (!(source.isFile() || source.isDirectory())) {
+ } else if (!(source.isFile() || source.isDirectory())) {
return vskip("'" + source + "' is a device");
- }
- else {
+ } else {
return true;
}
}
@@ -310,8 +295,7 @@
"' into a subdirectory ('" + target + "')");
}
}
- }
- else {
+ } else {
if (sourcePath.equals(targetPath)) {
return skip("Cannot copy file '" + source + "' to itself");
}
@@ -341,35 +325,33 @@
return vskip("Cannot copy '" + source + "' to device '" + target + "'");
}
switch (mode) {
- case MODE_NORMAL:
- return vskip("'" + target + "' already exists");
- case MODE_FORCE:
- return true;
- case MODE_UPDATE:
- return (source.lastModified() > target.lastModified() ||
+ case MODE_NORMAL:
+ return vskip("'" + target + "' already exists");
+ case MODE_FORCE:
+ return true;
+ case MODE_UPDATE:
+ return (source.lastModified() > target.lastModified() ||
vskip("'" + target + "' is newer than '" + source + "'"));
- case MODE_INTERACTIVE:
- out.print("Overwrite '" + target + "' with '" + source + "'? [y/n]");
- while (true) {
- try {
- String line = in.readLine();
- if (line == null) {
- error("EOF - abandoning copying");
- }
- if (line.length() > 0) {
- if (line.charAt(0) == 'y' || line.charAt(0) == 'Y') {
- return true;
+ case MODE_INTERACTIVE:
+ out.print("Overwrite '" + target + "' with '" + source + "'? [y/n]");
+ while (true) {
+ try {
+ String line = in.readLine();
+ if (line == null) {
+ error("EOF - abandoning copying");
}
- else if (line.charAt(0) == 'n' || line.charAt(0) == 'N') {
- return vskip("'" + target + "'");
+ if (line.length() > 0) {
+ if (line.charAt(0) == 'y' || line.charAt(0) == 'Y') {
+ return true;
+ } else if (line.charAt(0) == 'n' || line.charAt(0) == 'N') {
+ return vskip("'" + target + "'");
+ }
}
+ out.print("Answer 'y' or 'n'");
+ } catch (IOException ex) {
+ error("IO Error - abandoning copying");
}
- out.print("Answer 'y' or 'n'");
}
- catch (IOException ex) {
- error("IO Error - abandoning copying");
- }
- }
}
return false;
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/DFCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/DFCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/DFCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -54,31 +54,26 @@
super("Print file system usage information");
registerArguments(ARG_DEVICE);
}
- /*
- * (non-Javadoc)
- * @see org.jnode.shell.Command#execute(org.jnode.shell.CommandLine, java.io.InputStream, java.io.PrintStream, java.io.PrintStream)
- */
+
public void execute(CommandLine commandLine, InputStream in,
PrintStream out, PrintStream err) throws NameNotFoundException {
final FileSystemService fss = InitialNaming.lookup(FileSystemService.NAME);
- final Map mountPoints = fss.getDeviceMountPoints();
+ final Map<String, String> mountPoints = fss.getDeviceMountPoints();
out.println("ID\tTotal\tUse\tFree\tMount");
if (ARG_DEVICE.isSet()) {
final Device dev = ARG_DEVICE.getValue();
- FileSystem fs = fss.getFileSystem(dev);
+ FileSystem<?> fs = fss.getFileSystem(dev);
if (fs == null) {
out.println("No filesystem on device");
+ } else {
+ displayInfo(out, dev, fs, mountPoints.get(fs.getDevice().getId()));
}
- else {
- displayInfo(out, dev, fs,(String)mountPoints.get(fs.getDevice().getId()));
- }
- }
- else {
+ } else {
final DeviceManager dm = InitialNaming.lookup(DeviceManager.NAME);
for (Device dev : dm.getDevices()) {
- FileSystem fs = fss.getFileSystem(dev);
+ FileSystem<?> fs = fss.getFileSystem(dev);
if (fs != null) {
- displayInfo(out, dev, fs, (String)mountPoints.get(fs.getDevice().getId()));
+ displayInfo(out, dev, fs, mountPoints.get(fs.getDevice().getId()));
}
}
}
@@ -90,7 +85,7 @@
* @param fs
* @param mountPoint
*/
- private void displayInfo(PrintStream out, Device dev, FileSystem fs, String mountPoint) {
+ private void displayInfo(PrintStream out, Device dev, FileSystem<?> fs, String mountPoint) {
try {
long total = fs.getTotalSpace();
if (total > 0) {
Modified: trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/DeleteCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -102,8 +102,7 @@
err.println("Directory is not empty " + file);
deleteOk = false;
break;
- }
- else {
+ } else {
deleteOk &= deleteFile(f);
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/DirCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -59,7 +59,7 @@
}
public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
- throws IOException {
+ throws IOException {
File[] paths = ARG_PATH.getValues();
if (paths.length == 0) {
paths = new File[] {new File(System.getProperty("user.dir"))};
@@ -67,8 +67,7 @@
for (File path : paths) {
if (!path.exists()) {
err.println("No such path: " + path);
- }
- else {
+ } else {
if (paths.length > 1) {
out.println(path + ":");
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/EjectCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -39,29 +39,28 @@
*/
public class EjectCommand extends AbstractCommand {
- private final DeviceArgument ARG_DEVICE = new DeviceArgument(
- "device", Argument.MANDATORY, "device to eject the medium from",
- RemovableDeviceAPI.class);
-
- public EjectCommand() {
+ private final DeviceArgument ARG_DEVICE = new DeviceArgument(
+ "device", Argument.MANDATORY, "device to eject the medium from",
+ RemovableDeviceAPI.class);
+
+ public EjectCommand() {
super("Eject the medium from a given device");
registerArguments(ARG_DEVICE);
- }
-
- public static void main(String[] args) throws Exception {
- new EjectCommand().execute(args);
- }
+ }
- public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
- throws ApiNotFoundException, IOException {
- final Device dev = ARG_DEVICE.getValue();
- final RemovableDeviceAPI api = dev.getAPI(RemovableDeviceAPI.class);
- try {
- api.eject();
- }
- catch (IOException ex) {
- err.println("eject failed for " + dev.getId() + ": " + ex.getMessage());
- exit(1);
- }
- }
+ public static void main(String[] args) throws Exception {
+ new EjectCommand().execute(args);
+ }
+
+ public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
+ throws ApiNotFoundException, IOException {
+ final Device dev = ARG_DEVICE.getValue();
+ final RemovableDeviceAPI api = dev.getAPI(RemovableDeviceAPI.class);
+ try {
+ api.eject();
+ } catch (IOException ex) {
+ err.println("eject failed for " + dev.getId() + ": " + ex.getMessage());
+ exit(1);
+ }
+ }
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/HexdumpCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -41,7 +41,7 @@
}
public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
- throws IOException {
+ throws IOException {
InputStream is = null;
try {
// Set up the stream to be dumped.
@@ -49,28 +49,23 @@
if (ARG_FILE.isSet()) {
try {
is = new FileInputStream(file);
- }
- catch (FileNotFoundException ex) {
+ } catch (FileNotFoundException ex) {
err.println("Cannot open " + file + ": " + ex.getMessage());
exit(1);
}
- }
- else if (ARG_URL.isSet()) {
+ } else if (ARG_URL.isSet()) {
String urlStr = ARG_URL.getValue();
try {
URL url = new URL(urlStr);
is = url.openStream();
- }
- catch (MalformedURLException ex) {
+ } catch (MalformedURLException ex) {
err.println("Malformed URL '" + urlStr + "': " + ex.getMessage());
exit(1);
- }
- catch (IOException ex) {
+ } catch (IOException ex) {
err.println("Cannot access URL '" + urlStr + "': " + ex.getMessage());
exit(1);
}
- }
- else {
+ } else {
is = in;
}
@@ -131,13 +126,11 @@
}
}
out.flush();
- }
- finally {
+ } finally {
if (is != null && is != in) {
try {
is.close();
- }
- catch (IOException ex) {
+ } catch (IOException ex) {
/* ignore */
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/MkdirCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -27,7 +27,8 @@
import org.jnode.shell.AbstractCommand;
import org.jnode.shell.CommandLine;
-import org.jnode.shell.syntax.*;
+import org.jnode.shell.syntax.Argument;
+import org.jnode.shell.syntax.FileArgument;
/**
* @author Guillaume BINET (gb...@us...)
@@ -37,25 +38,25 @@
private final FileArgument ARG_DIR = new FileArgument(
"directory", Argument.MANDATORY, "the directory to create");
-
+
public MkdirCommand() {
super("Create a new directory");
registerArguments(ARG_DIR);
}
public static void main(String[] args) throws Exception {
- new MkdirCommand().execute(args);
+ new MkdirCommand().execute(args);
}
-
+
public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) {
- File dir = ARG_DIR.getValue();
+ File dir = ARG_DIR.getValue();
if (dir.exists()) {
err.println(dir.getPath() + " already exists.");
exit(1);
}
if (!dir.mkdir()) {
- err.println("Can't create directory.");
- exit(1);
+ err.println("Can't create directory.");
+ exit(1);
}
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/MountCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -33,7 +33,9 @@
import org.jnode.naming.InitialNaming;
import org.jnode.shell.AbstractCommand;
import org.jnode.shell.CommandLine;
-import org.jnode.shell.syntax.*;
+import org.jnode.shell.syntax.Argument;
+import org.jnode.shell.syntax.DeviceArgument;
+import org.jnode.shell.syntax.FileArgument;
/**
* @author Ewout Prangsma (ep...@us...)
@@ -65,30 +67,30 @@
if (!ARG_DEV.isSet()) {
// List all mounted file systems
- Map<String, FileSystem<?>> filesystems = fss.getMountPoints();
- for (String mountPoint : filesystems.keySet()) {
- FileSystem<?> fs = filesystems.get(mountPoint);
- Device device = fs.getDevice();
- String mode = fs.isReadOnly() ? "ro" : "rw";
- String type = fs.getType().getName();
- out.println(device.getId() + " on " + mountPoint + " type " + type + " (" + mode + ')');
- }
+ Map<String, FileSystem<?>> filesystems = fss.getMountPoints();
+ for (String mountPoint : filesystems.keySet()) {
+ FileSystem<?> fs = filesystems.get(mountPoint);
+ Device device = fs.getDevice();
+ String mode = fs.isReadOnly() ? "ro" : "rw";
+ String type = fs.getType().getName();
+ out.println(device.getId() + " on " + mountPoint + " type " + type + " (" + mode + ')');
+ }
}
else {
// Get the parameters
final Device dev = ARG_DEV.getValue();
- final File mountPoint = ARG_DIR.getValue();
- final File fsPath = ARG_FSPATH.getValue();
+ final File mountPoint = ARG_DIR.getValue();
+ final File fsPath = ARG_FSPATH.getValue();
- // Find the filesystem
- final FileSystem<?> fs = fss.getFileSystem(dev);
- if (fs == null) {
- err.println("No filesystem found on " + dev.getId());
- exit(1);
- } else {
- // Mount it
- fss.mount(mountPoint.toString(), fs, fsPath.toString());
- }
+ // Find the filesystem
+ final FileSystem<?> fs = fss.getFileSystem(dev);
+ if (fs == null) {
+ err.println("No filesystem found on " + dev.getId());
+ exit(1);
+ } else {
+ // Mount it
+ fss.mount(mountPoint.toString(), fs, fsPath.toString());
+ }
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/PwdCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/PwdCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/PwdCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -31,8 +31,7 @@
/**
* @author Martin Husted Hartvig (ha...@jn...)
*/
-public class PwdCommand extends AbstractCommand
-{
+public class PwdCommand extends AbstractCommand {
public PwdCommand() {
super("show the pathname of current working directory");
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/command/TouchCommand.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -46,14 +46,14 @@
super("touch a file");
registerArguments(ARG_FILE);
}
-
+
public static void main(String[] args) throws Exception {
- new TouchCommand().execute(args);
+ new TouchCommand().execute(args);
}
-
+
public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err)
throws Exception {
- File file = ARG_FILE.getValue();
+ File file = ARG_FILE.getValue();
if (!file.exists()) {
File parentFile = file.getParentFile();
if (parentFile != null && !parentFile.exists()) {
@@ -69,8 +69,7 @@
err.println("Cannot create file");
exit(1);
}
- }
- else {
+ } else {
file.setLastModified(System.currentTimeMillis());
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFileSystemType.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFileSystemType.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/ftpfs/FTPFileSystemType.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -48,4 +48,4 @@
public String getName() {
return "FTPFS";
}
-}
\ No newline at end of file
+}
Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Directory.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -353,4 +353,4 @@
return directoryEntry;
}
-}
\ No newline at end of file
+}
Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Driver.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Driver.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Driver.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -53,4 +53,4 @@
protected void stopDevice() throws DriverException {
}
-}
\ No newline at end of file
+}
Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2Entry.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -162,4 +162,4 @@
return fileHandle;
}
-}
\ No newline at end of file
+}
Modified: trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2FileSystemType.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2FileSystemType.java 2008-06-05 12:58:04 UTC (rev 4200)
+++ trunk/fs/src/fs/org/jnode/fs/nfs/nfs2/NFS2FileSystemType.java 2008-06-05 14:26:18 UTC (rev 4201)
@@ -49,4 +49,4 @@
public String getName() {
return "NFS2";
}
-}
\ No newline at end of file
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|