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

Reduce visibility and remove unused methods from FileInfoReader #599

Merged
merged 1 commit into from
Jan 7, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class FileInfoReader extends Job implements IRemoteFileSystemListener {
private final int connectionRetryCount;
private final long connectionRetryDelay;
private final IConnectContext connectContext;
final Boolean[] barrier = new Boolean[1];
private final Boolean[] barrier = new Boolean[1];
private IRemoteFile[] remoteFiles;
private IRemoteFileSystemRequest browseRequest;

Expand Down Expand Up @@ -82,7 +82,7 @@ private void waitOnSelf() {
* Create a new FileInfoReader that will retry failed connection attempts and sleep some amount of time between each
* attempt.
*/
public FileInfoReader(IConnectContext aConnectContext) {
FileInfoReader(IConnectContext aConnectContext) {
super(Messages.repo_loading); // job label - TODO: this is a bad label
barrier[0] = null;
// Hide this job.
Expand All @@ -101,7 +101,8 @@ public FileInfoReader(IConnectContext aConnectContext) {
* @throws AuthenticationFailedException
* @throws JREHttpClientRequiredException
*/
public IRemoteFile[] getRemoteFiles(URI location, IProgressMonitor monitor) throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {
private IRemoteFile[] getRemoteFiles(URI location, IProgressMonitor monitor)
throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {
if (monitor != null)
monitor.beginTask(location.toString(), 1);
try {
Expand All @@ -119,13 +120,14 @@ public IRemoteFile[] getRemoteFiles(URI location, IProgressMonitor monitor) thro

}

public IRemoteFile getRemoteFile(URI location, IProgressMonitor monitor) throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {
private IRemoteFile getRemoteFile(URI location, IProgressMonitor monitor)
throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {

getRemoteFiles(location, monitor);
return remoteFiles != null && remoteFiles.length > 0 ? remoteFiles[0] : null;
}

public long getLastModified(URI location, IProgressMonitor monitor) throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {
long getLastModified(URI location, IProgressMonitor monitor) throws AuthenticationFailedException, FileNotFoundException, CoreException, JREHttpClientRequiredException {
IRemoteFile file = getRemoteFile(location, monitor);
if (file == null)
throw new FileNotFoundException(location.toString());
Expand Down Expand Up @@ -157,7 +159,8 @@ public void handleRemoteFileEvent(IRemoteFileSystemEvent event) {
}
}

protected void sendBrowseRequest(URI uri, IProgressMonitor monitor) throws CoreException, FileNotFoundException, AuthenticationFailedException, JREHttpClientRequiredException {
private void sendBrowseRequest(URI uri, IProgressMonitor monitor)
throws CoreException, FileNotFoundException, AuthenticationFailedException, JREHttpClientRequiredException {
IContainer container;
try {
container = ContainerFactory.getDefault().createContainer();
Expand Down Expand Up @@ -191,10 +194,6 @@ protected void sendBrowseRequest(URI uri, IProgressMonitor monitor) throws CoreE
}
}

protected Exception getException() {
return exception;
}

/**
* Utility method to check exception condition and determine if retry should be done.
* If there was an exception it is translated into one of the specified exceptions and thrown.
Expand Down
Loading