mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Closes issue #539 : handle relative files again
This commit is contained in:
parent
4e3abafe30
commit
3912f3fd9f
|
@ -19,7 +19,6 @@ package com.google.zxing.client.j2se;
|
||||||
import com.beust.jcommander.JCommander;
|
import com.beust.jcommander.JCommander;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.nio.file.DirectoryStream;
|
import java.nio.file.DirectoryStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
@ -90,7 +89,7 @@ public final class CommandLineRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<URI> expand(List<URI> inputs) throws IOException, URISyntaxException {
|
private static List<URI> expand(List<URI> inputs) throws IOException {
|
||||||
List<URI> expanded = new ArrayList<>();
|
List<URI> expanded = new ArrayList<>();
|
||||||
for (URI input : inputs) {
|
for (URI input : inputs) {
|
||||||
if (isFileOrDir(input)) {
|
if (isFileOrDir(input)) {
|
||||||
|
@ -111,7 +110,7 @@ public final class CommandLineRunner {
|
||||||
for (int i = 0; i < expanded.size(); i++) {
|
for (int i = 0; i < expanded.size(); i++) {
|
||||||
URI input = expanded.get(i);
|
URI input = expanded.get(i);
|
||||||
if (input.getScheme() == null) {
|
if (input.getScheme() == null) {
|
||||||
expanded.set(i, new URI("file", input.getSchemeSpecificPart(), input.getFragment()));
|
expanded.set(i, Paths.get(input.getRawPath()).toUri());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return expanded;
|
return expanded;
|
||||||
|
|
Loading…
Reference in a new issue