Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
KochTobi committed Jul 3, 2023
1 parent 1e1d540 commit 7e7dddc
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ Example:
```bash
java -jar postman.jar list -u <user> <sample> @path/to/config.txt
```
The structure of the configuration file is: <code>[-cliOption] [value]</code>
The structure of the configuration file is:
```text
[-cliOption] [value]
```
For example: To set the ApplicationServerURL to another URL we have to use: <code>-as [URL]</code>

To use our openBIS URL we write the following lines in the config file:
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/life/qbic/qpostman/common/ProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,8 @@ private String buildProgressBar() {
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
String remainingTime = dateFormat.format(new Date(remainingDownloadTime));

for (int i = 0; i < numberProgressStrings; i++) {
progressBar.append("#");
}
for (int i = numberProgressStrings; i < BARSIZE; i++) {
progressBar.append(" ");
}
progressBar.append("#".repeat(Math.max(0, numberProgressStrings)));
progressBar.append(" ".repeat(Math.max(0, BARSIZE - numberProgressStrings)));

progressBar.append("]\t");
FileSize downloadedSize = FileSize.of(this.downloadedSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static java.util.Objects.requireNonNull;

import ch.ethz.sis.openbis.generic.asapi.v3.IApplicationServerApi;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.dataset.id.DataSetPermId;
import ch.ethz.sis.openbis.generic.dssapi.v3.IDataStoreServerApi;
import ch.ethz.sis.openbis.generic.dssapi.v3.dto.datasetfile.DataSetFile;
Expand All @@ -24,7 +23,7 @@ public class SearchFiles implements Function<Collection<DataSetWrapper>, Collect

private final Collection<IDataStoreServerApi> dataStoreServerApis;

public SearchFiles(IApplicationServerApi applicationServerApi, Collection<IDataStoreServerApi> dataStoreServerApis) {
public SearchFiles(Collection<IDataStoreServerApi> dataStoreServerApis) {
this.dataStoreServerApis = dataStoreServerApis;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void run() {
log.info(
"Downloading %s files (%s)".formatted(sortedFiles.size(), FileSizeFormatter.format(
FileSize.of(sortedFiles.stream().mapToLong(file -> file.fileSize().bytes()
).sum())), 6));
).sum()), 6)));
int counter = 0;
List<DownloadReport> downloadReports = sortedFiles.stream()
.map(functions.writeFileToDisk())
Expand Down Expand Up @@ -106,7 +106,7 @@ private Functions functions() {
OpenBisSessionProvider.init(applicationServerApi, authenticationOptions.user, new String(authenticationOptions.getPassword()));
SearchDataSets searchDataSets = new SearchDataSets(applicationServerApi);
Collection<IDataStoreServerApi> dataStoreServerApis = ServerFactory.dataStoreServers(serverOptions.dss_urls, serverOptions.timeoutInMillis);
SearchFiles searchFiles = new SearchFiles(applicationServerApi, dataStoreServerApis);
SearchFiles searchFiles = new SearchFiles(dataStoreServerApis);
FileFilter myAwesomeFileFilter = FileFilter.create().withSuffixes(filterOptions.suffixes);
WriteFileToDisk writeFileToDisk = new WriteFileToDisk(dataStoreServerApis.toArray(IDataStoreServerApi[]::new)[0],
downloadOptions.bufferSize, Path.of(downloadOptions.outputPath), downloadOptions.successiveDownloadAttempts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public DownloadReport apply(DataFile dataFile) {
return downloadReport;
}

record DownloadReport(long expectedCrc32, long actualCrc32, Path outputPath) {
public record DownloadReport(long expectedCrc32, long actualCrc32, Path outputPath) {
public boolean isSuccess() {
return expectedCrc32 == actualCrc32;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/life/qbic/qpostman/download/WriteUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private static Optional<Long> readCrc32FromFile(Path file) {
return Optional.empty();
}

try (BufferedReader reader = Files.newBufferedReader(crc32FileName);) {
try (BufferedReader reader = Files.newBufferedReader(crc32FileName)) {
String firstLine = reader.readLine();
return Optional.ofNullable(firstLine)
.map(line -> Long.parseLong(line.split("\\s+")[0], 16));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/life/qbic/qpostman/list/ListCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private Functions setupFunctions() {
SearchDataSets searchDataSets = new SearchDataSets(applicationServerApi);
FileFilter myAwesomeFileFilter = FileFilter.create()
.withSuffixes(filterOptions.suffixes);
SearchFiles searchFiles = new SearchFiles(applicationServerApi, dataStoreServerApis);
SearchFiles searchFiles = new SearchFiles(dataStoreServerApis);
FindSourceSample findSourceSample = new FindSourceSample(serverOptions.sourceSampleType);
DataFileFormatter dataFileFormatter = new DataFileFormatter(listOptions.exactFilesize);
SortFiles sortFiles = new SortFiles();
Expand Down
4 changes: 2 additions & 2 deletions src/test/groovy/FailingSpockTest.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import spock.lang.Ignore
import spock.lang.Specification;
import spock.lang.Specification

/**
* Use this test to see whether maven executes Spock tests or not.
Expand All @@ -8,6 +8,6 @@ import spock.lang.Specification;
class FailingSpockTest extends Specification {
def "this test always fails"() {
expect:
1 == 2;
1 == 2
}
}

0 comments on commit 7e7dddc

Please sign in to comment.