adammurdoch 2002/11/22 16:01:58
Modified: vfs/src/java/org/apache/commons/vfs Resources.properties
vfs/src/java/org/apache/commons/vfs/provider
AbstractFileObject.java
Log:
Corrected Javadocs, and fixed a couple of error messages.
Revision Changes Path
1.13 +2 -2
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/Resources.properties
Index: Resources.properties
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/Resources.properties,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Resources.properties 17 Nov 2002 03:39:20 -0000 1.12
+++ Resources.properties 23 Nov 2002 00:01:58 -0000 1.13
@@ -16,8 +16,8 @@
vfs.provider/list-children.error=Could not list the contents of folder "{0}".
vfs.provider/delete-read-only.error=Could not delete "{0}" because it is read-only.
vfs.provider/delete.error=Could not delete "{0}".
-vfs.provider/create-mismatched-type.error=Could not create {0} "{1}" because it
already exists and is a {2}.
-vfs.provider/create-read-only.error=Could not create {0} "{1}" because the file
system is read-only.
+vfs.provider/create-folder-mismatched-type.error=Could not create folder "{0}"
because it already exists and is a file.
+vfs.provider/create-folder-read-only.error=Could not create folder "{0}" because
its parent folder is read-only.
vfs.provider/create-folder.error=Could not create folder "{0}".
vfs.provider/create-file.error=Could not create file "{0}".
vfs.provider/write-read-only.error=Could not write to "{0}" because it is read-only.
1.20 +23 -26
jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
Index: AbstractFileObject.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- AbstractFileObject.java 20 Nov 2002 23:57:13 -0000 1.19
+++ AbstractFileObject.java 23 Nov 2002 00:01:58 -0000 1.20
@@ -161,9 +161,9 @@
/**
* Deletes the file. Is only called when:
* <ul>
- * <li>{@link #isWriteable} returns true.
* <li>{@link #doGetType} does not return null.
- * <li>This file has no children.
+ * <li>{@link #doIsWriteable} returns true.
+ * <li>This file has no children, if a folder.
* </ul>
*/
protected void doDelete() throws Exception
@@ -174,10 +174,9 @@
/**
* Creates this file as a folder. Is only called when:
* <ul>
- * <li>{@link #isWriteable} returns true.
* <li>{@link #doGetType} returns null.
- * <li>The parent folder exists or this file is the root of the file
- * system.
+ * <li>The parent folder exists and is writeable, or this file is the
+ * root of the file system.
* </ul>
*/
protected void doCreateFolder() throws Exception
@@ -193,9 +192,9 @@
}
/**
- * Called from {@link DefaultFileContent#getLastModifiedTime}.
- * The default is to just throw an exception so filesystems must
- * override it to use it.
+ * Returns the last modified time of this file. Is only called if
+ * {@link #doGetType} does not return null. This implementation throws
+ * an exception.
*/
protected long doGetLastModifiedTime() throws Exception
{
@@ -203,9 +202,9 @@
}
/**
- * Called from {@link DefaultFileContent#setLastModifiedTime}.
- * The default is to just throw an exception so filesystems must
- * override it to use it.
+ * Sets the last modified time of this file. Is only called if
+ * {@link #doGetType} does not return null. This implementation
+ * throws an exception.
*/
protected void doSetLastModifiedTime( long modtime )
throws Exception
@@ -214,9 +213,8 @@
}
/**
- * Called from {@link DefaultFileContent#getAttribute}.
- * The default implementation just returns null so filesystems must
- * override it to use it.
+ * Gets an attribute of this file. Is only called if {@link #doGetType}
+ * does not return null. This implementation return null.
*/
protected Object doGetAttribute( final String attrName )
throws Exception
@@ -225,9 +223,8 @@
}
/**
- * Called from {@link DefaultFileContent#setAttribute}.
- * The default is to just throw an exception so filesystems must
- * override it to use it.
+ * Sets an attribute of this file. Is only called if {@link #doGetType}
+ * does not return null. This implementation throws an exception.
*/
protected void doSetAttribute( String atttrName, Object value )
throws Exception
@@ -236,9 +233,9 @@
}
/**
- * Called from {@link DefaultFileContent#getCertificates}.
- * The default implementation just returns null so filesystems must
- * override it to use it.
+ * Returns the certificates used to sign this file. Is only called if
+ * {@link #doGetType} does not return null. This implementation returns
+ * null.
*/
protected Certificate[] doGetCertificates() throws FileSystemException
{
@@ -253,7 +250,7 @@
/**
* Creates an input stream to read the file content from. Is only called
- * if {@link #doGetType} returns {@link FileType#FILE}.
+ * if {@link #doGetType} returns {@link FileType#FILE}.
*
* <p>There is guaranteed never to be more than one stream for this file
* (input or output) open at any given time.
@@ -266,7 +263,7 @@
* Creates an output stream to write the file content to. Is only
* called if:
* <ul>
- * <li>This file is not read-only.
+ * <li>{@link #doIsWriteable} returns true.
* <li>{@link #doGetType} returns {@link FileType#FILE}, or
* {@link #doGetType} returns null, and the file's parent exists
* and is a folder.
@@ -646,18 +643,18 @@
public void createFolder() throws FileSystemException
{
attach();
- if ( this.type == FileType.FOLDER )
+ if ( type == FileType.FOLDER )
{
// Already exists as correct type
return;
}
- if ( this.type != null )
+ if ( type != null )
{
- throw new FileSystemException(
"vfs.provider/create-mismatched-type.error", new Object[]{type, name, this.type}, null
);
+ throw new FileSystemException(
"vfs.provider/create-folder-mismatched-type.error", name );
}
if ( !isWriteable() )
{
- throw new FileSystemException( "vfs.provider/create-read-only.error",
new Object[]{type, name}, null );
+ throw new FileSystemException(
"vfs.provider/create-folder-read-only.error", name );
}
// Traverse up the heirarchy and make sure everything is a folder
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>