diff --git a/commons-vfs2-ant/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java b/commons-vfs2-ant/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java index f1c59a1b2b..1be3a93426 100644 --- a/commons-vfs2-ant/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java +++ b/commons-vfs2-ant/src/main/java/org/apache/commons/vfs2/tasks/AbstractSyncTask.java @@ -71,7 +71,7 @@ public void setFile(final String file) { private String destDirUrl; private String srcDirUrl; private boolean srcDirIsBase; - private boolean failonerror = true; + private boolean failOnError = true; private String filesList; @@ -346,7 +346,7 @@ protected void handleUpToDateFile(final FileObject srcFile, final FileObject des * @return true if the operation should fail if there was an error. */ public boolean isFailonerror() { - return failonerror; + return failOnError; } protected void logOrDie(final String message, final int level) { @@ -360,28 +360,28 @@ protected void logOrDie(final String message, final int level) { /** * Sets the destination directory. * - * @param destDir The destination directory. + * @param destDirUrl The destination directory. */ - public void setDestDir(final String destDir) { - this.destDirUrl = destDir; + public void setDestDir(final String destDirUrl) { + this.destDirUrl = destDirUrl; } /** * Sets the destination file. * - * @param destFile The destination file name. + * @param destFileUrl The destination file name. */ - public void setDestFile(final String destFile) { - this.destFileUrl = destFile; + public void setDestFile(final String destFileUrl) { + this.destFileUrl = destFileUrl; } /** * Sets whether we should fail if there was an error or not. * - * @param failonerror true if the operation should fail if there is an error. + * @param failOnError true if the operation should fail if there is an error. */ - public void setFailonerror(final boolean failonerror) { - this.failonerror = failonerror; + public void setFailonerror(final boolean failOnError) { + this.failOnError = failOnError; } /** @@ -407,10 +407,10 @@ public void setSrc(final String srcFile) { /** * Sets the source directory. * - * @param srcDir The source directory. + * @param srcDirUrl The source directory. */ - public void setSrcDir(final String srcDir) { - this.srcDirUrl = srcDir; + public void setSrcDir(final String srcDirUrl) { + this.srcDirUrl = srcDirUrl; } /** diff --git a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java index fa194e3db7..b8f009a6a9 100644 --- a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java +++ b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileObject.java @@ -74,7 +74,7 @@ public boolean canRenameTo(final FileObject newfile) { return false; } try { - return this.hdfs.getFileStatus(new Path(newfile.getName().getPath())) == null; + return hdfs.getFileStatus(new Path(newfile.getName().getPath())) == null; } catch (final FileNotFoundException e) { return false; } catch (final IOException e) { @@ -88,9 +88,9 @@ public boolean canRenameTo(final FileObject newfile) { @Override protected void doAttach() throws Exception { try { - this.stat = this.hdfs.getFileStatus(this.path); + stat = hdfs.getFileStatus(path); } catch (final FileNotFoundException e) { - this.stat = null; + stat = null; } } @@ -100,7 +100,7 @@ protected void doAttach() throws Exception { */ @Override protected void doCreateFolder() throws Exception { - hdfs.mkdirs(this.path); + hdfs.mkdirs(path); } /** @@ -109,7 +109,7 @@ protected void doCreateFolder() throws Exception { */ @Override protected void doDelete() throws Exception { - hdfs.delete(this.path, true); + hdfs.delete(path, true); } /** @@ -117,17 +117,17 @@ protected void doDelete() throws Exception { */ @Override protected Map doGetAttributes() throws Exception { - if (null == this.stat) { + if (null == stat) { return super.doGetAttributes(); } final Map attrs = new HashMap<>(); - attrs.put(HdfsFileAttributes.LAST_ACCESS_TIME.toString(), this.stat.getAccessTime()); - attrs.put(HdfsFileAttributes.BLOCK_SIZE.toString(), this.stat.getBlockSize()); - attrs.put(HdfsFileAttributes.GROUP.toString(), this.stat.getGroup()); - attrs.put(HdfsFileAttributes.OWNER.toString(), this.stat.getOwner()); - attrs.put(HdfsFileAttributes.PERMISSIONS.toString(), this.stat.getPermission().toString()); - attrs.put(HdfsFileAttributes.LENGTH.toString(), this.stat.getLen()); - attrs.put(HdfsFileAttributes.MODIFICATION_TIME.toString(), this.stat.getModificationTime()); + attrs.put(HdfsFileAttributes.LAST_ACCESS_TIME.toString(), stat.getAccessTime()); + attrs.put(HdfsFileAttributes.BLOCK_SIZE.toString(), stat.getBlockSize()); + attrs.put(HdfsFileAttributes.GROUP.toString(), stat.getGroup()); + attrs.put(HdfsFileAttributes.OWNER.toString(), stat.getOwner()); + attrs.put(HdfsFileAttributes.PERMISSIONS.toString(), stat.getPermission().toString()); + attrs.put(HdfsFileAttributes.LENGTH.toString(), stat.getLen()); + attrs.put(HdfsFileAttributes.MODIFICATION_TIME.toString(), stat.getModificationTime()); return attrs; } @@ -144,7 +144,7 @@ protected long doGetContentSize() throws Exception { */ @Override protected InputStream doGetInputStream(final int bufferSize) throws Exception { - return this.hdfs.open(this.path, bufferSize); + return hdfs.open(path, bufferSize); } /** @@ -153,8 +153,8 @@ protected InputStream doGetInputStream(final int bufferSize) throws Exception { @Override protected long doGetLastModifiedTime() throws Exception { doAttach(); - if (null != this.stat) { - return this.stat.getModificationTime(); + if (null != stat) { + return stat.getModificationTime(); } return -1; } @@ -166,9 +166,9 @@ protected long doGetLastModifiedTime() throws Exception { @Override protected OutputStream doGetOutputStream(final boolean append) throws Exception { if (append) { - throw new FileSystemException("vfs.provider/write-append-not-supported.error", this.path.getName()); + throw new FileSystemException("vfs.provider/write-append-not-supported.error", path.getName()); } - return hdfs.create(this.path); + return hdfs.create(path); } /** @@ -180,7 +180,7 @@ protected RandomAccessContent doGetRandomAccessContent(final RandomAccessMode mo if (mode.equals(RandomAccessMode.READWRITE)) { throw new UnsupportedOperationException(); } - return new HdfsRandomAccessContent(this.path, this.hdfs); + return new HdfsRandomAccessContent(path, hdfs); } /** @@ -231,11 +231,11 @@ protected boolean doIsWriteable() throws Exception { */ @Override protected String[] doListChildren() throws Exception { - if (this.doGetType() != FileType.FOLDER) { + if (doGetType() != FileType.FOLDER) { throw new FileNotFolderException(this); } - final FileStatus[] fileStatuses = this.hdfs.listStatus(this.path); + final FileStatus[] fileStatuses = hdfs.listStatus(path); return Stream.of(fileStatuses).filter(Objects::nonNull).map(status -> status.getPath().getName()).toArray(String[]::new); } @@ -244,14 +244,14 @@ protected String[] doListChildren() throws Exception { */ @Override protected FileObject[] doListChildrenResolved() throws Exception { - if (this.doGetType() != FileType.FOLDER) { + if (doGetType() != FileType.FOLDER) { return null; } final String[] children = doListChildren(); final FileObject[] fo = new FileObject[children.length]; for (int i = 0; i < children.length; i++) { - final Path p = new Path(this.path, children[i]); - fo[i] = this.fs.resolveFile(p.toUri().toString()); + final Path p = new Path(path, children[i]); + fo[i] = fs.resolveFile(p.toUri().toString()); } return fo; } @@ -270,7 +270,7 @@ protected void doRemoveAttribute(final String attrName) throws Exception { */ @Override protected void doRename(final FileObject newfile) throws Exception { - hdfs.rename(this.path, new Path(newfile.getName().getPath())); + hdfs.rename(path, new Path(newfile.getName().getPath())); } /** @@ -287,7 +287,7 @@ protected void doSetAttribute(final String attrName, final Object value) throws @Override protected boolean doSetLastModifiedTime(final long modtime) throws Exception { try { - hdfs.setTimes(this.path, modtime, System.currentTimeMillis()); + hdfs.setTimes(path, modtime, System.currentTimeMillis()); } catch (final IOException ioe) { throw new FileSystemException(ioe); } @@ -302,7 +302,7 @@ protected boolean doSetLastModifiedTime(final long modtime) throws Exception { public boolean exists() throws FileSystemException { try { doAttach(); - return this.stat != null; + return stat != null; } catch (final FileNotFoundException fne) { return false; } catch (final Exception e) { diff --git a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java index 5b21dc9ef4..844128b03b 100644 --- a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java +++ b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileProvider.java @@ -51,7 +51,7 @@ public class HdfsFileProvider extends AbstractOriginatingFileProvider { * Constructs a new HdfsFileProvider. */ public HdfsFileProvider() { - this.setFileNameParser(HttpFileNameParser.getInstance()); + setFileNameParser(HttpFileNameParser.getInstance()); } /** diff --git a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java index d81707447d..b61c6a3877 100644 --- a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java +++ b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsFileSystem.java @@ -97,7 +97,7 @@ protected FileObject createFile(final AbstractFileName name) throws Exception { @Override public FileObject resolveFile(final FileName name) throws FileSystemException { synchronized (this) { - if (this.fs == null) { + if (fs == null) { final String hdfsUri = name.getRootURI(); final HdfsFileSystemConfigBuilder builder = HdfsFileSystemConfigBuilder.getInstance(); final FileSystemOptions options = getFileSystemOptions(); @@ -161,7 +161,7 @@ public FileObject resolveFile(final FileName name) throws FileSystemException { fileObject = new HdfsFileObject((AbstractFileName) name, this, fs, filePath); fileObject = decorateFileObject(fileObject); if (useCache) { - this.putFileToCache(fileObject); + putFileToCache(fileObject); } } /* diff --git a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java index a1dbf4200b..b19b36a3b5 100644 --- a/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java +++ b/commons-vfs2-hdfs/src/main/java/org/apache/commons/vfs2/provider/hdfs/HdfsRandomAccessContent.java @@ -48,7 +48,7 @@ public HdfsRandomAccessContent(final Path path, final FileSystem fs) throws IOEx super(RandomAccessMode.READ); this.fs = fs; this.path = path; - this.fis = this.fs.open(this.path); + fis = this.fs.open(this.path); } /** @@ -56,7 +56,7 @@ public HdfsRandomAccessContent(final Path path, final FileSystem fs) throws IOEx */ @Override public void close() throws IOException { - this.fis.close(); + fis.close(); } /** @@ -64,7 +64,7 @@ public void close() throws IOException { */ @Override public long getFilePointer() throws IOException { - return this.fis.getPos(); + return fis.getPos(); } /** @@ -72,7 +72,7 @@ public long getFilePointer() throws IOException { */ @Override public InputStream getInputStream() throws IOException { - return this.fis; + return fis; } /** @@ -80,7 +80,7 @@ public InputStream getInputStream() throws IOException { */ @Override public long length() throws IOException { - return this.fs.getFileStatus(this.path).getLen(); + return fs.getFileStatus(path).getLen(); } /** @@ -88,7 +88,7 @@ public long length() throws IOException { */ @Override public boolean readBoolean() throws IOException { - return this.fis.readBoolean(); + return fis.readBoolean(); } /** @@ -96,7 +96,7 @@ public boolean readBoolean() throws IOException { */ @Override public byte readByte() throws IOException { - return this.fis.readByte(); + return fis.readByte(); } /** @@ -104,7 +104,7 @@ public byte readByte() throws IOException { */ @Override public char readChar() throws IOException { - return this.fis.readChar(); + return fis.readChar(); } /** @@ -112,7 +112,7 @@ public char readChar() throws IOException { */ @Override public double readDouble() throws IOException { - return this.fis.readDouble(); + return fis.readDouble(); } /** @@ -120,7 +120,7 @@ public double readDouble() throws IOException { */ @Override public float readFloat() throws IOException { - return this.fis.readFloat(); + return fis.readFloat(); } /** @@ -144,7 +144,7 @@ public void readFully(final byte[] b, final int off, final int len) throws IOExc */ @Override public int readInt() throws IOException { - return this.fis.readInt(); + return fis.readInt(); } /** @@ -153,7 +153,7 @@ public int readInt() throws IOException { @Override @SuppressWarnings("deprecation") public String readLine() throws IOException { - return this.fis.readLine(); + return fis.readLine(); } /** @@ -161,7 +161,7 @@ public String readLine() throws IOException { */ @Override public long readLong() throws IOException { - return this.fis.readLong(); + return fis.readLong(); } /** @@ -169,7 +169,7 @@ public long readLong() throws IOException { */ @Override public short readShort() throws IOException { - return this.fis.readShort(); + return fis.readShort(); } /** @@ -177,7 +177,7 @@ public short readShort() throws IOException { */ @Override public int readUnsignedByte() throws IOException { - return this.fis.readUnsignedByte(); + return fis.readUnsignedByte(); } /** @@ -185,7 +185,7 @@ public int readUnsignedByte() throws IOException { */ @Override public int readUnsignedShort() throws IOException { - return this.fis.readUnsignedShort(); + return fis.readUnsignedShort(); } /** @@ -193,7 +193,7 @@ public int readUnsignedShort() throws IOException { */ @Override public String readUTF() throws IOException { - return this.fis.readUTF(); + return fis.readUTF(); } /** @@ -201,7 +201,7 @@ public String readUTF() throws IOException { */ @Override public void seek(final long pos) throws IOException { - this.fis.seek(pos); + fis.seek(pos); } /** diff --git a/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java b/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java index bcad10923d..92da12fe6b 100644 --- a/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java +++ b/commons-vfs2-jackrabbit1/src/main/java/org/apache/commons/vfs2/provider/webdav/WebdavFileObject.java @@ -191,7 +191,7 @@ protected void onClose() throws IOException { log(e); } } - ((DefaultFileContent) this.file.getContent()).resetAttributes(); + ((DefaultFileContent) file.getContent()).resetAttributes(); } private void setUserName(final URLFileName fileName, final String urlStr) throws IOException { @@ -544,7 +544,7 @@ private String hrefString(final URLFileName name) { final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), null, null, name.getPath(), name.getType(), name.getQueryString()); try { - return newFile.getURIEncoded(this.getUrlCharset()); + return newFile.getURIEncoded(getUrlCharset()); } catch (final Exception e) { return name.getURI(); } @@ -598,9 +598,9 @@ private String resourceName(String path) { */ @Override protected void setupMethod(final HttpMethod method) throws FileSystemException, URIException { - final String pathEncoded = ((URLFileName) getName()).getPathQueryEncoded(this.getUrlCharset()); + final String pathEncoded = ((URLFileName) getName()).getPathQueryEncoded(getUrlCharset()); method.setPath(pathEncoded); - method.setFollowRedirects(this.getFollowRedirect()); + method.setFollowRedirects(getFollowRedirect()); method.setRequestHeader("User-Agent", "Jakarta-Commons-VFS"); method.addRequestHeader("Cache-control", "no-cache"); method.addRequestHeader("Cache-store", "no-store"); @@ -629,7 +629,7 @@ private String toUrlString(final URLFileName name, final boolean includeUserInfo final URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(), name.getDefaultPort(), user, password, name.getPath(), name.getType(), name.getQueryString()); try { - return newFile.getURIEncoded(this.getUrlCharset()); + return newFile.getURIEncoded(getUrlCharset()); } catch (final Exception e) { return name.getURI(); } diff --git a/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java b/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java index 4aa5bf13d3..89f0fe6157 100644 --- a/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java +++ b/commons-vfs2-jackrabbit2/src/main/java/org/apache/commons/vfs2/provider/webdav4/Webdav4FileObject.java @@ -201,7 +201,7 @@ protected void onClose() throws IOException { } } } - ((DefaultFileContent) this.file.getContent()).resetAttributes(); + ((DefaultFileContent) file.getContent()).resetAttributes(); } private void setUserName(final GenericURLFileName fileName, final String urlStr) throws IOException { @@ -574,7 +574,7 @@ private String hrefString(final GenericURLFileName name) { try { final GenericURLFileName newFile = new GenericURLFileName(getInternalURI().getScheme(), name.getHostName(), name.getPort(), name.getDefaultPort(), null, null, name.getPath(), name.getType(), name.getQueryString()); - return newFile.getURIEncoded(this.getUrlCharset()); + return newFile.getURIEncoded(getUrlCharset()); } catch (final Exception e) { return name.getURI(); } @@ -656,7 +656,7 @@ private String toUrlString(final GenericURLFileName name, final boolean includeU final GenericURLFileName newFile = new Webdav4FileName(getInternalURI().getScheme(), name.getHostName(), name.getPort(), name.getDefaultPort(), user, password, name.getPath(), name.getType(), name.getQueryString(), builder.getAppendTrailingSlash(getFileSystem().getFileSystemOptions())); - return newFile.getURIEncoded(this.getUrlCharset()); + return newFile.getURIEncoded(getUrlCharset()); } catch (final Exception e) { return name.getURI(); } diff --git a/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java b/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java index 1c507cbfe4..4f3dabf652 100644 --- a/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java +++ b/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/RACRandomAccessFile.java @@ -47,7 +47,7 @@ public RACRandomAccessFile(final RandomAccessContent rac) throws IOException { @Override public void close() throws IOException { - this.rac.close(); + rac.close(); } private void deleteTempFile(final File tempFile) { @@ -62,22 +62,22 @@ private void deleteTempFile(final File tempFile) { @Override public long getFilePointer() throws IOException { - return this.rac.getFilePointer(); + return rac.getFilePointer(); } @Override public InputStream getInputStream() throws IOException { - return this.rac.getInputStream(); + return rac.getInputStream(); } @Override public long length() throws IOException { - return this.rac.length(); + return rac.length(); } @Override public final int read() throws IOException { - final byte[] buf = this.singleByteBuf; + final byte[] buf = singleByteBuf; final int count = read(buf, 0, 1); return count < 0 ? -1 : buf[0] & 0xFF; } @@ -89,13 +89,13 @@ public final int read(final byte[] b) throws IOException { @Override public int read(final byte[] b, final int off, final int len) throws IOException { - this.rac.readFully(b, off, len); + rac.readFully(b, off, len); return len; } @Override public void seek(final long pos) throws IOException { - this.rac.seek(pos); + rac.seek(pos); } @Override @@ -105,7 +105,7 @@ public void setLength(final long newLength) throws IOException { @Override public int skipBytes(final int n) throws IOException { - return this.rac.skipBytes(n); + return rac.skipBytes(n); } @Override @@ -115,12 +115,12 @@ public final void write(final byte[] b) throws IOException { @Override public void write(final byte[] b, final int off, final int len) throws IOException { - this.rac.write(b, off, len); + rac.write(b, off, len); } @Override public final void write(final int b) throws IOException { - final byte[] buf = this.singleByteBuf; + final byte[] buf = singleByteBuf; buf[0] = (byte) b; write(buf, 0, 1); } diff --git a/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java b/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java index a43e11ebc9..048bae768a 100644 --- a/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java +++ b/commons-vfs2-sandbox/src/main/java/org/apache/commons/vfs2/util/SharedRandomContentInputStream.java @@ -120,8 +120,8 @@ public synchronized void mark(final int readLimit) { @Override public InputStream newStream(final long start, final long end) { try { - final long newFileStart = this.fileStart + start; - final long newFileEnd = end < 0 ? this.fileEnd : this.fileStart + end; + final long newFileStart = fileStart + start; + final long newFileEnd = end < 0 ? fileEnd : fileStart + end; final RandomAccessContent rac = fo.getContent().getRandomAccessContent(RandomAccessMode.READ); rac.seek(newFileStart); diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/CacheStrategy.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/CacheStrategy.java index a69b390d02..1aaf77f2a3 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/CacheStrategy.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/CacheStrategy.java @@ -42,8 +42,8 @@ public enum CacheStrategy { */ private final String realName; - CacheStrategy(final String name) { - this.realName = name; + CacheStrategy(final String realName) { + this.realName = realName; } /** diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java index 37a57c2555..c9ecf440a7 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java @@ -88,9 +88,9 @@ private static final class FileMonitorAgent { private long timestamp; private Map children; - private FileMonitorAgent(final DefaultFileMonitor fm, final FileObject file) { - this.defaultFileMonitor = fm; - this.fileObject = file; + private FileMonitorAgent(final DefaultFileMonitor defaultFileMonitor, final FileObject fileObject) { + this.defaultFileMonitor = defaultFileMonitor; + this.fileObject = fileObject; refresh(); resetChildrenList(); diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java index 3c683195f5..ccef4ac835 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileName.java @@ -79,7 +79,7 @@ public static boolean checkName(final String basePath, final String path, final throw new IllegalArgumentException(); } private final String scheme; - private final String absPath; + private final String absolutePath; private FileType type; // Cached attributes @@ -104,11 +104,11 @@ public AbstractFileName(final String scheme, final String absolutePath, final Fi this.scheme = scheme; this.type = type; if (StringUtils.isEmpty(absolutePath)) { - absPath = ROOT_PATH; + this.absolutePath = ROOT_PATH; } else if (absolutePath.length() > 1 && absolutePath.endsWith("/")) { - this.absPath = absolutePath.substring(0, absolutePath.length() - 1); + this.absolutePath = absolutePath.substring(0, absolutePath.length() - 1); } else { - this.absPath = absolutePath; + this.absolutePath = absolutePath; } } @@ -148,7 +148,7 @@ protected String createURI() { private String createURI(final boolean useAbsolutePath, final boolean usePassword) { final StringBuilder buffer = new StringBuilder(); appendRootUri(buffer, usePassword); - buffer.append(handleURISpecialCharacters(useAbsolutePath ? absPath : getPath())); + buffer.append(handleURISpecialCharacters(useAbsolutePath ? absolutePath : getPath())); return buffer.toString(); } @@ -280,9 +280,9 @@ public FileName getParent() { @Override public String getPath() { if (VFS.isUriStyle()) { - return absPath + getUriTrailer(); + return absolutePath + getUriTrailer(); } - return absPath; + return absolutePath; } /** @@ -518,7 +518,6 @@ void setType(final FileType type) throws FileSystemException { if (type != FileType.FOLDER && type != FileType.FILE && type != FileType.FILE_OR_FOLDER) { throw new FileSystemException("vfs.provider/filename-type.error"); } - this.type = type; } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java index e505d28111..e988a4cbc9 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java @@ -105,18 +105,18 @@ public abstract class AbstractFileSystem extends AbstractVfsComponent implements /** * Constructs a new instance. * - * @param rootFileName The root file name of this file system. + * @param rootName The root file name of this file system. * @param parentLayer The parent layer of this file system. * @param fileSystemOptions Options to build this file system. */ - protected AbstractFileSystem(final FileName rootFileName, final FileObject parentLayer, final FileSystemOptions fileSystemOptions) { + protected AbstractFileSystem(final FileName rootName, final FileObject parentLayer, final FileSystemOptions fileSystemOptions) { this.parentLayer = parentLayer; - this.rootName = rootFileName; + this.rootName = rootName; this.fileSystemOptions = fileSystemOptions; final FileSystemConfigBuilder builder = DefaultFileSystemConfigBuilder.getInstance(); String uri = builder.getRootURI(fileSystemOptions); if (uri == null) { - uri = rootFileName != null ? rootFileName.getURI() : null; + uri = rootName != null ? rootName.getURI() : null; } this.rootURI = uri; } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java index b14793476c..07a754bacd 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/DelegateFileObject.java @@ -58,14 +58,14 @@ public class DelegateFileObject extends Abstract * * @param fileName the file name. * @param fileSystem the file system. - * @param file My file object. + * @param fileObject My file object. * @throws FileSystemException For subclasses to throw. */ - public DelegateFileObject(final AbstractFileName fileName, final AFS fileSystem, final FileObject file) throws FileSystemException { + public DelegateFileObject(final AbstractFileName fileName, final AFS fileSystem, final FileObject fileObject) throws FileSystemException { super(fileName, fileSystem); - this.fileObject = file; - if (file != null) { - WeakRefFileListener.installListener(file, this); + this.fileObject = fileObject; + if (fileObject != null) { + WeakRefFileListener.installListener(fileObject, this); } } @@ -410,16 +410,15 @@ public void refresh() throws FileSystemException { /** * Attaches or detaches the target file. * - * @param file The FileObject. + * @param fileObject The FileObject. * @throws Exception if an error occurs. */ - public void setFile(final FileObject file) throws Exception { + public void setFile(final FileObject fileObject) throws Exception { final FileType oldType = doGetType(); - - if (file != null) { - WeakRefFileListener.installListener(file, this); + if (fileObject != null) { + WeakRefFileListener.installListener(fileObject, this); } - this.fileObject = file; + this.fileObject = fileObject; maybeTypeChanged(oldType); } } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileType.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileType.java index d85660d69b..67dd9b957f 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileType.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileType.java @@ -48,7 +48,7 @@ public enum FtpFileType { /** * The Apache Commons Net FTP file type. */ - private final int value; + private final int fileType; /** * Constructs a file type. @@ -56,7 +56,7 @@ public enum FtpFileType { * @param fileType The Apache Commons Net FTP file type. */ FtpFileType(final int fileType) { - this.value = fileType; + this.fileType = fileType; } /** @@ -65,6 +65,6 @@ public enum FtpFileType { * @return The Apache Commons Net FTP file type. */ int getValue() { - return value; + return fileType; } } diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java index 66d3ec51ed..6d519179f8 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java @@ -220,10 +220,10 @@ void setContent(final byte[] content) { } /** - * @param lastModified The lastModified to set. + * @param lastModifiedMillis The lastModified to set. */ - void setLastModified(final long lastModified) { - this.lastModifiedMillis = lastModified; + void setLastModified(final long lastModifiedMillis) { + this.lastModifiedMillis = lastModifiedMillis; } /**