Skip to content

Commit

Permalink
fix: issue OpenRefine#6418. Add a getFileName method
Browse files Browse the repository at this point in the history
Add a getFileName method in the ImportingUtilities so it can be used to
get the name of the file from the fileRecord.
  • Loading branch information
Kurocifer committed Apr 30, 2024
1 parent 3c96ac9 commit ab51969
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main/src/com/google/refine/importing/ImportingUtilities.java
Expand Up @@ -605,6 +605,14 @@ static public String getFileSource(ObjectNode fileRecord) {
JSONUtilities.getString(fileRecord, "url", "unknown"));
}

static public String getFileName(ObjectNode fileRecord) {
return JSONUtilities.getString(
fileRecord,
"fileName",
"unknown"
);
}

static public String getArchiveFileName(ObjectNode fileRecord) {
return JSONUtilities.getString(
fileRecord,
Expand Down
Expand Up @@ -41,6 +41,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down

0 comments on commit ab51969

Please sign in to comment.