Skip to content

Commit 050af77

Browse files
Remove unused method
1 parent d2e7fa2 commit 050af77

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

src/main/java/com/conveyal/r5/analyst/progress/ProgressInputStream.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.conveyal.r5.analyst.progress;
22

33
import com.conveyal.file.FileUtils;
4-
import org.apache.commons.fileupload.FileItem;
54
import org.apache.commons.io.input.ProxyInputStream;
65

76
import java.io.File;
@@ -15,7 +14,7 @@
1514
* This will report progress as the total number of bytes that have passed through the stream, like CountingInputStream.
1615
* This can exceed 100% of the file size if the caller uses mark and reset. The progressListener should be
1716
* pre-configured with the total number of bytes expected and a detail message using ProgressListener::beginTask.
18-
* The static method forFileItem() demonstrates usage when reading from a file of known length.
17+
* The static method forFile() demonstrates usage when reading from a file of known length.
1918
*/
2019
public class ProgressInputStream extends ProxyInputStream {
2120

@@ -40,22 +39,6 @@ public synchronized long skip (final long length) throws IOException {
4039
return skippedBytes;
4140
}
4241

43-
/**
44-
* Given an uploaded file, report progress on reading it.
45-
* Incrementing the progress seems to introduce some inefficiency when performing unbuffered small reads, such as
46-
* calls to InputStream.read() which are used by DataInputStream to read numbers.
47-
* TODO wrap in buffered input stream to reduce small read calls, or tune to only report once per percentage?
48-
*/
49-
public static ProgressInputStream forFileItem (FileItem fileItem, ProgressListener progressListener) {
50-
try {
51-
checkArgument(fileItem.getSize() < Integer.MAX_VALUE);
52-
progressListener.beginTask("Reading file " + fileItem.getName(), (int)(fileItem.getSize()));
53-
return new ProgressInputStream(progressListener, fileItem.getInputStream());
54-
} catch (IOException e) {
55-
throw new RuntimeException(e);
56-
}
57-
}
58-
5942
/**
6043
* Given an uploaded file, report progress on reading it.
6144
*/

0 commit comments

Comments
 (0)