Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotations #1389

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cdm/core/src/main/java/thredds/filesystem/ControllerOS.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import thredds.inventory.CollectionConfig;
import thredds.inventory.MController;
import thredds.inventory.MFile;

import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
import java.io.File;
import java.util.*;
Expand All @@ -53,6 +55,7 @@ public class ControllerOS implements MController {

////////////////////////////////////////

@Nullable
@Override
public Iterator<MFile> getInventoryAll(CollectionConfig mc, boolean recheck) {
String path = mc.getDirectoryName();
Expand All @@ -68,6 +71,7 @@ public Iterator<MFile> getInventoryAll(CollectionConfig mc, boolean recheck) {
return new FilteredIterator(mc, new MFileIteratorAll(cd), false);
}

@Nullable
@Override
public Iterator<MFile> getInventoryTop(CollectionConfig mc, boolean recheck) {
String path = mc.getDirectoryName();
Expand All @@ -83,6 +87,7 @@ public Iterator<MFile> getInventoryTop(CollectionConfig mc, boolean recheck) {
return new FilteredIterator(mc, new MFileIterator(cd), false); // removes subdirs
}

@Nullable
public Iterator<MFile> getSubdirs(CollectionConfig mc, boolean recheck) {
String path = mc.getDirectoryName();
if (path.startsWith("file:")) {
Expand Down
4 changes: 4 additions & 0 deletions cdm/core/src/main/java/thredds/inventory/MController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package thredds.inventory;

import javax.annotation.Nullable;
import java.io.IOException;
import java.util.Iterator;

Expand All @@ -23,6 +24,7 @@ public interface MController {
* @param recheck if false, may use cached results. otherwise must sync with File OS
* @return iterator over Mfiles, or null if collection does not exist
*/
@Nullable
Iterator<MFile> getInventoryAll(CollectionConfig mc, boolean recheck);

/**
Expand All @@ -32,6 +34,7 @@ public interface MController {
* @param recheck if false, may use cached results. otherwise must sync with File OS
* @return iterator over Mfiles, or null if collection does not exist
*/
@Nullable
Iterator<MFile> getInventoryTop(CollectionConfig mc, boolean recheck) throws IOException;

/**
Expand All @@ -41,6 +44,7 @@ public interface MController {
* @param recheck if false, may use cached results. otherwise must sync with File OS
* @return iterator over Mfiles, or null if collection does not exist
*/
@Nullable
Iterator<MFile> getSubdirs(CollectionConfig mc, boolean recheck);

void close();
Expand Down
Loading