Skip to content

Commit

Permalink
Javadoc: Add missing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Dec 24, 2024
1 parent c8b82f9 commit eb68ced
Show file tree
Hide file tree
Showing 49 changed files with 228 additions and 37 deletions.
2 changes: 1 addition & 1 deletion checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<suppress checks="FinalClass" files="URIUtils.java"/>
<suppress checks="FinalClass" files="ZipFileSystemConfigBuilder.java"/>
<!-- Can't change method name without breaking binary compatibility. -->
<suppress checks="MethodName" files="DefaultFileSystemManager.java" lines="185"/>
<suppress checks="MethodName" files="DefaultFileSystemManager.java" lines="192"/>
<!-- Use of literals here is reasonable. -->
<suppress checks="MagicNumber" files="URIUtils.java" lines="143, 152, 162"/>
<suppress checks="MagicNumber" files="RamFileRandomAccessContent.java"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ public static HdfsFileSystemConfigBuilder getInstance() {
return BUILDER;
}

/**
* Constructs a new instance.
*/
private HdfsFileSystemConfigBuilder() {
super("hdfs.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static FileNameParser getInstance() {
}

/**
* Creates a new instance with the default port 139.
* Constructs a new instance with the default port 139.
*/
public SmbFileNameParser() {
super(SMB_PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
*/
public class AllFileSelector implements FileSelector {

/**
* Constructs a new instance.
*/
public AllFileSelector() {
// empty
}

/**
* Determines if a file or folder should be selected.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,20 +478,6 @@ protected <T> T getParam(final FileSystemOptions fileSystemOptions, final String
return fileSystemOptions == null ? null : fileSystemOptions.getOption(getConfigClass(), name);
}

/**
* Gets a named parameter.
*
* @param <T> The expected return type.
* @param fileSystemOptions file system options to query, may be null.
* @param name get option with this name
* @param defaultValue The default value if absent.
* @return the named option or {@code defaultValue}.
* @since 2.10.0
*/
protected <T> T getParamOrDefault(final FileSystemOptions fileSystemOptions, final String name, final T defaultValue) {
return fileSystemOptions == null ? defaultValue : fileSystemOptions.getOptionOrDefault(getConfigClass(), name, defaultValue);
}

/**
* Gets a named parameter.
*
Expand All @@ -518,6 +504,20 @@ private <T> T getParam(final FileSystemOptions fileSystemOptions, final String n
return value;
}

/**
* Gets a named parameter.
*
* @param <T> The expected return type.
* @param fileSystemOptions file system options to query, may be null.
* @param name get option with this name
* @param defaultValue The default value if absent.
* @return the named option or {@code defaultValue}.
* @since 2.10.0
*/
protected <T> T getParamOrDefault(final FileSystemOptions fileSystemOptions, final String name, final T defaultValue) {
return fileSystemOptions == null ? defaultValue : fileSystemOptions.getOptionOrDefault(getConfigClass(), name, defaultValue);
}

/**
* Gets the system property for the given name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
*/
public abstract class AbstractFilesCache extends AbstractVfsComponent implements FilesCache {

/**
* Constructs a new instance for subclasses.
*/
public AbstractFilesCache() {
// empty
}

/**
* Default implementation is a NOOP.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ public class DefaultFilesCache extends AbstractFilesCache {
/** The FileSystem cache. Keeps one Map for each FileSystem. */
private final ConcurrentMap<FileSystem, ConcurrentMap<FileName, FileObject>> fileSystemCache = new ConcurrentHashMap<>(10);

/**
* Constructs a new instance.
*/
public DefaultFilesCache() {
// empty
}

@Override
public void clear(final FileSystem filesystem) {
// avoid keeping a reference to the FileSystem (key) object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
*/
public class NullFilesCache extends AbstractFilesCache {

/**
* Constructs a new instance.
*/
public NullFilesCache() {
// empty
}

@Override
public void clear(final FileSystem filesystem) {
// empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private synchronized void close(final FileSystem fileSystem) {
}

/**
* Creates a new Reference.
* Constructs a new Reference.
*
* @param file a file object.
* @param referenceQueue a ReferenceQueue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
*/
public class WeakRefFilesCache extends SoftRefFilesCache {

/**
* Constructs a new instance.
*/
public WeakRefFilesCache() {
// empty
}

@Override
protected Reference<FileObject> createReference(final FileObject file, final ReferenceQueue<FileObject> refqueue) {
return new WeakReference<>(file, refqueue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public abstract class AbstractFileChangeEvent extends FileChangeEvent {

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*
* @param fileObject the file object.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
// TODO Add a Builder so we can construct and start.
public class DefaultFileMonitor implements Runnable, FileMonitor, AutoCloseable {

private static final ThreadFactory THREAD_FACTORY = new BasicThreadFactory.Builder().daemon(true).priority(Thread.MIN_PRIORITY).build();

/**
* File monitor agent.
*/
Expand Down Expand Up @@ -266,6 +264,8 @@ private void resetChildrenList() {

}

private static final ThreadFactory THREAD_FACTORY = new BasicThreadFactory.Builder().daemon(true).priority(Thread.MIN_PRIORITY).build();

private static final Log LOG = LogFactory.getLog(DefaultFileMonitor.class);

private static final Duration DEFAULT_DELAY = Duration.ofSeconds(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Default options usable for all file systems.
*/
public class DefaultFileSystemConfigBuilder extends FileSystemConfigBuilder {

/**
* Dummy class that implements FileSystem.
*/
Expand All @@ -43,6 +44,13 @@ public static DefaultFileSystemConfigBuilder getInstance() {
return BUILDER;
}

/**
* Constructs a new instance.
*/
public DefaultFileSystemConfigBuilder() {
// empty
}

@Override
protected Class<? extends FileSystem> getConfigClass() {
return DefaultFileSystem.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ public URLStreamHandler createURLStreamHandler(final String protocol) {
*/
private boolean init;

/**
* Constructs a new instance.
*/
public DefaultFileSystemManager() {
// empty
}

/**
* Closes the given file system.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
* Same as {@link ProviderConfiguration} but for the default provider.
*/
public class DefaultProviderConfiguration extends ProviderConfiguration {

/**
* Constructs a new instance.
*/
public DefaultProviderConfiguration() {
// empty
}

@Override
public boolean isDefault() {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ public class FileContentInfoFilenameFactory implements FileContentInfoFactory {

private static final FileContentInfo NULL_INSTANCE = new DefaultFileContentInfo(null, null);

/**
* Constructs a new instance.
*/
public FileContentInfoFilenameFactory() {
// empty
}

@Override
public FileContentInfo create(final FileContent fileContent) {
String contentType = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public class StandardFileSystemManager extends DefaultFileSystemManager {
private URL configUri;
private ClassLoader classLoader;

/**
* Constructs a new instance.
*/
public StandardFileSystemManager() {
// empty
}

/**
* Adds an extension map.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
*/
public class VirtualFileProvider extends AbstractVfsContainer {

/**
* Constructs a new instance.
*/
public VirtualFileProvider() {
// empty
}

/**
* Close a VirtualFileSystem by removing it from the {@code #components} list of this provider.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public abstract class AbstractFileOperation implements FileOperation {
private final FileObject fileObject;

/**
* Constructs a new instance for subclasses.
*
* @param file The FileObject.
*/
public AbstractFileOperation(final FileObject file) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ public abstract class AbstractFileOperationProvider implements FileOperationProv
*/
private final Collection<Class<? extends FileOperation>> operations = new ArrayList<>();

/**
* Constructs a new instance for subclasses.
*/
public AbstractFileOperationProvider() {
// empty
}

/**
* Add new FileOperation to list of known operations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static boolean checkName(final String basePath, final String path, final
private String key;

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*
* @param scheme The scheme.
* @param absolutePath the absolute path, maybe empty or null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
*/
public abstract class AbstractFileNameParser implements FileNameParser {

/**
* Constructs a new instance for subclasses.
*/
public AbstractFileNameParser() {
// empty
}

@Override
public boolean encodeCharacter(final char ch) {
return ch == '%';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private static void traverse(final DefaultFileSelectorInfo fileInfo, final FileS
private FileOperations operations;

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*
* @param fileName the file name.
* @param fileSystem the file system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class AbstractFileProvider extends AbstractVfsContainer implemen
private FileNameParser fileNameParser;

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*/
public AbstractFileProvider() {
fileNameParser = GenericFileNameParser.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ public abstract class AbstractFileSystem extends AbstractVfsComponent implements
*/
private final AtomicInteger openStreams = new AtomicInteger();

/** Only provided for Serializable subclasses. */
/**
* Only provided for Serializable subclasses.
*/
AbstractFileSystem() {
this(null, null, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public abstract class AbstractLayeredFileProvider extends AbstractFileProvider {

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*/
public AbstractLayeredFileProvider() {
setFileNameParser(LayeredFileNameParser.getInstance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public abstract class AbstractOriginatingFileProvider extends AbstractFileProvider {

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*/
public AbstractOriginatingFileProvider() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public abstract class AbstractRandomAccessContent implements RandomAccessContent {

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*
* @param mode the RandomAccessMode.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public abstract class AbstractRandomAccessStreamContent extends AbstractRandomAccessContent {

/**
* Constructs a new instance.
* Constructs a new instance for subclasses.
*
* @param mode the RandomAccessMode.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ public abstract class AbstractVfsComponent implements VfsComponent {
private VfsComponentContext context;
private Log log;

/**
* Constructs a new instance for subclasses.
*/
public AbstractVfsComponent() {
// empty
}

/**
* Closes the provider. This implementation does nothing.
*/
Expand Down
Loading

0 comments on commit eb68ced

Please sign in to comment.