diff --git a/proposal/myrmidon/src/java/org/apache/antlib/core/IfTask.java b/proposal/myrmidon/src/java/org/apache/antlib/core/IfTask.java index 8105d6d10..d6272638d 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/core/IfTask.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/core/IfTask.java @@ -28,7 +28,7 @@ import org.apache.myrmidon.interfaces.executor.Executor; public class IfTask extends AbstractContainerTask { - private static final Resources REZ = + private final static Resources REZ = ResourceManager.getPackageResources( IfTask.class ); private Condition m_condition; diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileObject.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileObject.java index 9cfaebc98..31c4befbc 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileObject.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileObject.java @@ -22,10 +22,13 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -class FtpFileObject extends AbstractFileObject +class FtpFileObject + extends AbstractFileObject { - private static final Resources REZ - = ResourceManager.getPackageResources( FtpFileObject.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( FtpFileObject.class ); + + private final static FTPFile[] EMPTY_FTP_FILE_ARRAY = {}; private FtpFileSystem m_ftpFs; @@ -33,12 +36,11 @@ class FtpFileObject extends AbstractFileObject private FTPFile m_fileInfo; private FTPFile[] m_children; - private static final FTPFile[] EMPTY_FTP_FILE_ARRAY = {}; - public FtpFileObject( FileName name, FtpFileSystem fs ) + public FtpFileObject( final FileName name, final FtpFileSystem fileSystem ) { - super( name, fs ); - m_ftpFs = fs; + super( name, fileSystem ); + m_ftpFs = fileSystem; } /** @@ -74,7 +76,8 @@ class FtpFileObject extends AbstractFileObject /** * Attaches this file object to its file resource. */ - protected void doAttach() throws Exception + protected void doAttach() + throws Exception { // Get the parent folder to find the info for this file FtpFileObject parent = (FtpFileObject)getParent(); @@ -106,7 +109,8 @@ class FtpFileObject extends AbstractFileObject * Determines the type of the file, returns null if the file does not * exist. */ - protected FileType doGetType() throws Exception + protected FileType doGetType() + throws Exception { if( m_fileInfo == null ) { @@ -129,7 +133,8 @@ class FtpFileObject extends AbstractFileObject /** * Lists the children of the file. */ - protected String[] doListChildren() throws Exception + protected String[] doListChildren() + throws Exception { if( m_children == null ) { @@ -166,7 +171,8 @@ class FtpFileObject extends AbstractFileObject /** * Creates this file as a folder. */ - protected void doCreateFolder() throws Exception + protected void doCreateFolder() + throws Exception { if( !m_ftpFs.getClient().makeDirectory( getName().getPath() ) ) { @@ -194,7 +200,8 @@ class FtpFileObject extends AbstractFileObject /** * Notification of the input stream being closed. */ - protected void doEndInput() throws Exception + protected void doEndInput() + throws Exception { if( !m_ftpFs.getClient().completePendingCommand() ) { @@ -206,7 +213,8 @@ class FtpFileObject extends AbstractFileObject /** * Creates an output stream to write the file content to. */ - protected OutputStream doGetOutputStream() throws Exception + protected OutputStream doGetOutputStream() + throws Exception { return m_ftpFs.getClient().storeFileStream( getName().getPath() ); } @@ -214,7 +222,8 @@ class FtpFileObject extends AbstractFileObject /** * Notification of the output stream being closed. */ - protected void doEndOutput() throws Exception + protected void doEndOutput() + throws Exception { if( !m_ftpFs.getClient().completePendingCommand() ) { diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystem.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystem.java index 0b6c96220..b47e3b63e 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystem.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystem.java @@ -23,17 +23,19 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -class FtpFileSystem extends AbstractFileSystem +class FtpFileSystem + extends AbstractFileSystem { - private static final Resources REZ - = ResourceManager.getPackageResources( FtpFileSystem.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( FtpFileSystem.class ); private FTPClient m_client; - public FtpFileSystem( FileName rootName, - String hostname, - String username, - String password ) throws FileSystemException + public FtpFileSystem( final FileName rootName, + final String hostname, + final String username, + final String password ) + throws FileSystemException { super( rootName ); try @@ -95,7 +97,8 @@ class FtpFileSystem extends AbstractFileSystem /** * Creates a file object. */ - protected FileObject createFile( FileName name ) throws FileSystemException + protected FileObject createFile( FileName name ) + throws FileSystemException { return new FtpFileObject( name, this ); } diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFile.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFile.java index 5ca6ad562..3a59556be 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFile.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFile.java @@ -25,10 +25,12 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -final class LocalFile extends AbstractFileObject implements FileObject +final class LocalFile + extends AbstractFileObject + implements FileObject { - private static final Resources REZ - = ResourceManager.getPackageResources( LocalFile.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( LocalFile.class ); private File m_file; private String m_fileName; @@ -36,16 +38,19 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Creates a non-root file. */ - public LocalFile( LocalFileSystem fs, String fileName, FileName name ) + public LocalFile( final LocalFileSystem fileSystem, + final String fileName, + final FileName name ) { - super( name, fs ); + super( name, fileSystem ); m_fileName = fileName; } /** * Attaches this file object to its file resource. */ - protected void doAttach() throws Exception + protected void doAttach() + throws Exception { if( m_file == null ) { @@ -56,7 +61,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Returns the file's type. */ - protected FileType doGetType() throws Exception + protected FileType doGetType() + throws Exception { if( !m_file.exists() ) { @@ -78,7 +84,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Returns the children of the file. */ - protected String[] doListChildren() throws Exception + protected String[] doListChildren() + throws Exception { return m_file.list(); } @@ -86,7 +93,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Deletes this file, and all children. */ - public void doDelete() throws Exception + public void doDelete() + throws Exception { if( !m_file.delete() ) { @@ -98,7 +106,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Creates this folder. */ - protected void doCreateFolder() throws Exception + protected void doCreateFolder() + throws Exception { if( !m_file.mkdir() ) { @@ -110,7 +119,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Creates an input stream to read the content from. */ - protected InputStream doGetInputStream() throws Exception + protected InputStream doGetInputStream() + throws Exception { return new FileInputStream( m_file ); } @@ -118,7 +128,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Creates an output stream to write the file content to. */ - protected OutputStream doGetOutputStream() throws Exception + protected OutputStream doGetOutputStream() + throws Exception { return new FileOutputStream( m_file ); } @@ -126,7 +137,8 @@ final class LocalFile extends AbstractFileObject implements FileObject /** * Returns the size of the file content (in bytes). */ - protected long doGetContentSize() throws Exception + protected long doGetContentSize() + throws Exception { return m_file.length(); } diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFileNameParser.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFileNameParser.java index 3eeee412f..dfa5417d0 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFileNameParser.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/local/LocalFileNameParser.java @@ -19,10 +19,11 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -class LocalFileNameParser extends UriParser +class LocalFileNameParser + extends UriParser { - private static final Resources REZ - = ResourceManager.getPackageResources( LocalFileNameParser.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( LocalFileNameParser.class ); private boolean m_windowsNames; @@ -35,7 +36,7 @@ class LocalFileNameParser extends UriParser /** * Determines if a name is an absolute file name. */ - public boolean isAbsoluteName( String name ) + public boolean isAbsoluteName( final String name ) { // TODO - this is yucky StringBuffer b = new StringBuffer( name ); @@ -54,10 +55,10 @@ class LocalFileNameParser extends UriParser /** * Parses an absolute URI, splitting it into its components. * - * @param name - * The URI. + * @param uriStr The URI. */ - public ParsedUri parseUri( String uriStr ) throws FileSystemException + public ParsedUri parseUri( final String uriStr ) + throws FileSystemException { StringBuffer name = new StringBuffer(); ParsedFileUri uri = new ParsedFileUri(); @@ -90,8 +91,8 @@ class LocalFileNameParser extends UriParser /** * Pops the root prefix off a URI, which has had the scheme removed. */ - private String extractRootPrefix( String uri, - StringBuffer name ) + private String extractRootPrefix( final String uri, + final StringBuffer name ) throws FileSystemException { // TODO - split this into sub-classes @@ -116,8 +117,8 @@ class LocalFileNameParser extends UriParser /** * Extracts a Windows root prefix from a name. */ - private String extractWindowsRootPrefix( String uri, - StringBuffer name ) + private String extractWindowsRootPrefix( final String uri, + final StringBuffer name ) throws FileSystemException { // Looking for: @@ -158,7 +159,8 @@ class LocalFileNameParser extends UriParser /** * Extracts a drive prefix from a path. Leading '/' chars have been removed. */ - private String extractDrivePrefix( StringBuffer name ) throws FileSystemException + private String extractDrivePrefix( final StringBuffer name ) + throws FileSystemException { // Looking for ':' '/' if( name.length() < 3 ) @@ -191,8 +193,9 @@ class LocalFileNameParser extends UriParser /** * Extracts a UNC name from a path. Leading '/' chars have been removed. */ - private String extractUNCPrefix( String uri, - StringBuffer name ) throws FileSystemException + private String extractUNCPrefix( final String uri, + final StringBuffer name ) + throws FileSystemException { // Looking for '/' ( '/' | ) diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileNameParser.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileNameParser.java index 1c4d87333..2f2a5e788 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileNameParser.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileNameParser.java @@ -18,10 +18,11 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -public class SmbFileNameParser extends UriParser +public class SmbFileNameParser + extends UriParser { - private static final Resources REZ - = ResourceManager.getPackageResources( SmbFileNameParser.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( SmbFileNameParser.class ); /** * Parses an absolute URI, splitting it into its components. diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileObject.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileObject.java index 6620ffa95..044bfea4b 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileObject.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/smb/SmbFileObject.java @@ -25,17 +25,21 @@ import org.apache.avalon.excalibur.i18n.Resources; * * @author Adam Murdoch */ -public class SmbFileObject extends AbstractFileObject implements FileObject +public class SmbFileObject + extends AbstractFileObject + implements FileObject { - private static final Resources REZ - = ResourceManager.getPackageResources( SmbFileObject.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( SmbFileObject.class ); private String m_fileName; private SmbFile m_file; - protected SmbFileObject( String fileName, FileName name, SmbFileSystem fs ) + protected SmbFileObject( final String fileName, + final FileName name, + final SmbFileSystem fileSystem ) { - super( name, fs ); + super( name, fileSystem ); m_fileName = fileName; } diff --git a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystem.java b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystem.java index 78f11077d..4f9624184 100644 --- a/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystem.java +++ b/proposal/myrmidon/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystem.java @@ -28,8 +28,8 @@ import org.apache.avalon.excalibur.i18n.Resources; */ public class ZipFileSystem extends AbstractFileSystem implements FileSystem { - private static final Resources REZ - = ResourceManager.getPackageResources( ZipFileSystem.class ); + private final static Resources REZ = + ResourceManager.getPackageResources( ZipFileSystem.class ); private File m_file; private ZipFile m_zipFile; diff --git a/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java b/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java index deae74522..e269bcfc8 100644 --- a/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java +++ b/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java @@ -33,10 +33,10 @@ public class DefaultExtensionManager extends DefaultPackageRepository implements LogEnabled, Parameterizable, Initializable, Disposable, ExtensionManager { - private static final Resources REZ = + private final static Resources REZ = ResourceManager.getPackageResources( DefaultExtensionManager.class ); - private static final String TOOLS_JAR = File.separator + "lib" + File.separator + "tools.jar"; + private final static String TOOLS_JAR = File.separator + "lib" + File.separator + "tools.jar"; private Logger m_logger;