Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Aug 12, 2024
1 parent cdacc5c commit 243ed5b
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ public class SmbFileName extends GenericFileName {
private final String domain;
private String uriWithoutAuth;

/**
* Constructs a new instance.
*
* @param scheme the scheme.
* @param hostName the host name.
* @param port the port.
* @param userName the user name.
* @param password the password.
* @param domain the domain.
* @param share the share.
* @param path the absolute path, maybe empty or null.
* @param type the file type.
*/
protected SmbFileName(final String scheme, final String hostName, final int port, final String userName,
final String password, final String domain, final String share, final String path, final FileType type) {
super(scheme, hostName, port, DEFAULT_PORT, userName, password, path, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ public class GenericFileName extends AbstractFileName {
private final String password;
private final int port;

/**
* Constructs a new instance.
*
* @param scheme the scheme.
* @param hostName the host name.
* @param port the port.
* @param defaultPort the default port.
* @param userName the user name.
* @param password the password.
* @param path the absolute path, maybe empty or null.
* @param type the file type.
*/
protected GenericFileName(final String scheme, final String hostName, final int port, final int defaultPort,
final String userName, final String password, final String path, final FileType type) {
super(scheme, path, type);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ public class LocalFileName extends AbstractFileName {

private final String rootFile;

/**
* Constructs a new instance.
*
* @param scheme the scheme.
* @param rootFile the root file.
* @param path the absolute path, maybe empty or null.
* @param type the file type.
*/
protected LocalFileName(final String scheme, final String rootFile, final String path, final FileType type) {
super(scheme, path, type);
this.rootFile = rootFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
public class WindowsFileName extends LocalFileName {

/**
* Constructs a new instance.
*
* @param scheme the scheme.
* @param rootFile the root file.
* @param path the absolute path, maybe empty or null.
* @param type the file type.
*/
protected WindowsFileName(final String scheme, final String rootFile, final String path, final FileType type) {
super(scheme, rootFile, path, type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
*/
public class ResourceFileName extends AbstractFileName {

/**
* Constructs a new instance.
*
* @param scheme The scheme.
* @param path the absolute path, maybe empty or null.
* @param type the file type.
*/
protected ResourceFileName(final String scheme, final String path, final FileType type) {
super(scheme, path, type);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ public InputStream getInputStream(final TarArchiveEntry entry) throws FileSystem
}
}

/**
* Gets the TarArchiveInputStream.
*
* @return the TarArchiveInputStream.
* @throws FileSystemException if a file system error occurs.
*/
protected TarArchiveInputStream getTarFile() throws FileSystemException {
if (tarFile == null && file.exists()) {
recreateTarFile();
Expand Down Expand Up @@ -223,7 +229,6 @@ protected void putFileToCache(final FileObject file) {
* will be called after all file-objects closed their streams. protected void notifyAllStreamsClosed() {
* closeCommunicationLink(); }
*/

private void recreateTarFile() throws FileSystemException {
if (tarFile != null) {
try {
Expand All @@ -244,6 +249,11 @@ protected void removeFileFromCache(final FileName name) {
cache.remove(name);
}

/**
* Resets the tar file.
*
* @throws FileSystemException if a file system error occurs.
*/
protected void resetTarFile() throws FileSystemException {
// Reading specific entries requires skipping through the tar file from the beginning
// Not especially elegant, but we don't have the ability to seek to specific positions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
package org.apache.commons.vfs2.provider.url;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

import org.apache.commons.httpclient.URIException;
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileType;
Expand Down Expand Up @@ -53,7 +52,14 @@ protected UrlFileObject(final UrlFileSystem fileSystem, final AbstractFileName f
super(fileName, fileSystem);
}

protected URL createURL(final FileName name) throws MalformedURLException, FileSystemException, URIException {
/**
* Creates a URL from the given file name.
*
* @param name the file name.
* @return a new URL.
* @throws IOException if an I/O error occurs.
*/
protected URL createURL(final FileName name) throws IOException {
if (name instanceof URLFileName) {
final URLFileName urlName = (URLFileName) getName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
*/
public class UrlFileSystem extends AbstractFileSystem {

/**
* Constructs a new instance.
*
* @param rootName The root file name of this file system.
* @param fileSystemOptions Options to build this file system.
*/
protected UrlFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions) {
super(rootName, null, fileSystemOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ public static void installListener(final FileObject file, final FileListener lis

private final WeakReference<FileListener> listener;

/**
* Constructs a new instance.
*
* @param file the file object.
* @param listener the file listener.
*/
protected WeakRefFileListener(final FileObject file, final FileListener listener) {
fs = file.getFileSystem();
name = file.getName();
Expand Down

0 comments on commit 243ed5b

Please sign in to comment.