Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: bash <(curl -s https://codecov.io/bash) -Z
-
name: Build Docker Image
run: mvn spring-boot:build-image -f pom.xml -P prod
run: mvn spring-boot:build-image -f pom.xml
-
name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latestRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: mvn clean test -f pom.xml
-
name: Build Docker Image
run: mvn spring-boot:build-image -f pom.xml -P prod
run: mvn spring-boot:build-image -f pom.xml
-
name: Upload CodeCov.
run: bash <(curl -s https://codecov.io/bash) -Z
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stableRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: mvn clean test -f pom.xml
-
name: Build Docker Image
run: mvn spring-boot:build-image -f pom.xml -P prod
run: mvn spring-boot:build-image -f pom.xml
-
name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ public FileSystemRestController(FileSystemRestServiceInterface fileSystemRestSer
this.fileSystemRestService = fileSystemRestService;
}

@GetMapping(FS_BASE_URI + "{fsItemId}/contents")
@GetMapping(FS_BASE_URI + "contents")
public EntityModel<FolderContents> getContentsOfFolder(
@PathVariable long fsItemId,
@RequestHeader(value = "X-FF-PATH", defaultValue = "/") String path,
@RequestHeader(value = "Authorization", defaultValue = AUTHORIZATION_BEARER_PREFIX + "token") String accessToken
) {

LOG.info("Requested Folder contents of id {}.", fsItemId);
return fileSystemRestService.getContentsOfFolderByIdAndAccessToken(fsItemId, accessToken);
LOG.info("Requested Folder contents of folder with path {}.", path);
return fileSystemRestService.getContentsOfFolderByIdAndAccessToken(path, accessToken);
}

@GetMapping(FS_BASE_URI + "{fsItemId}/info")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class FileSystemRestService implements FileSystemRestServiceInterface {

@Override
public EntityModel<FolderContents> getContentsOfFolderByIdAndAccessToken(long fsItemId, String accessToken) {
public EntityModel<FolderContents> getContentsOfFolderByIdAndAccessToken(String path, String accessToken) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.springframework.hateoas.EntityModel;

public interface FileSystemRestServiceInterface {
EntityModel<FolderContents> getContentsOfFolderByIdAndAccessToken(long fsItemId, String accessToken);
EntityModel<FolderContents> getContentsOfFolderByIdAndAccessToken(String path, String accessToken);
EntityModel<FileSystemItem> getInfoAboutFileOrFolderByIdAndAccessToken(long fsItemId, String accessToken);
EntityModel<FileSystemItem> findFileOrFolderByNameAndAccessToken(String name, String accessToken);
EntityModel<FileSystemItem> uploadFileSystemItemWithAccessToken(FileSystemItemUpdate fileSystemItemUpdate, String accessToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ void getContentsOfFolder() {
.files(new File[]{dummyFile})
.folders(new Folder[]{dummyFolder}).create());

long id = 420;
String path= "/root/data.txt";
String token = "token";

when(fileSystemRestServiceMock.getContentsOfFolderByIdAndAccessToken(id, token)).thenReturn(expectedModel);
when(fileSystemRestServiceMock.getContentsOfFolderByIdAndAccessToken(path, token)).thenReturn(expectedModel);

EntityModel<FolderContents> actualModel = fileSystemRestController.getContentsOfFolder(id, token);
EntityModel<FolderContents> actualModel = fileSystemRestController.getContentsOfFolder(path, token);
assertEquals(expectedModel, actualModel);
}

Expand Down