Skip to content

Commit 8390b04

Browse files
committed
Remove WorkspaceService.isMetadataFile in favor of RenderType method
1 parent a23011e commit 8390b04

2 files changed

Lines changed: 3 additions & 18 deletions

File tree

workspace-server/src/main/java/gov/nasa/jpl/aerie/workspace/server/WorkspaceFileSystemService.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,9 @@ private Path resolveMetadataPath(final Path rootPath, final Path filePath) throw
116116
throw new WorkspaceFileOpException("Cannot resolve metadata file path: %s is a directory.".formatted(baseFilePath.getFileName()));
117117
}
118118

119-
try {
120-
if (isMetadataFile(baseFilePath)) {
121-
throw new WorkspaceFileOpException("Cannot resolve metadata file path: %s is already a metadata file.".formatted(
122-
baseFilePath.getFileName()));
123-
}
124-
}
125-
catch (SQLException se) {
126-
throw new WorkspaceFileOpException("Cannot resolve metadata file path: Unable to validate metadata file extensions", se);
119+
if (RenderType.isAerieMetadataFile(baseFilePath.getFileName().toString())) {
120+
throw new WorkspaceFileOpException("Cannot resolve metadata file path: %s is already a metadata file.".formatted(
121+
baseFilePath.getFileName()));
127122
}
128123

129124
// Convert base file path to metadata file path
@@ -271,11 +266,6 @@ public RenderType getFileType(final Path filePath) throws SQLException {
271266
return RenderType.getRenderType(fileName, postgresRepository.getExtensionMapping());
272267
}
273268

274-
@Override
275-
public boolean isMetadataFile(final Path filePath) throws SQLException {
276-
return getFileType(filePath) == RenderType.METADATA;
277-
}
278-
279269
//region Workspace Operations
280270
@Override
281271
public Optional<Integer> createWorkspace(final Path workspaceLocation, final String workspaceName, String username, int parcelId) {

workspace-server/src/main/java/gov/nasa/jpl/aerie/workspace/server/WorkspaceService.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ boolean copyDirectory(final int sourceWorkspaceId, final Path sourceFilePath, fi
112112

113113
boolean deleteDirectory(final int workspaceId, final Path directoryPath) throws NoSuchWorkspaceException;
114114

115-
/**
116-
* Check if the specified file is a Metadata-type file
117-
*/
118-
boolean isMetadataFile(final Path filePath) throws SQLException;
119-
120115
/**
121116
* Retrieve the associated metadata file for the given file.
122117
* Returns an JSON file with only "version" specified in the event said file does not exist.

0 commit comments

Comments
 (0)