-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6a434e2
commit 52ba2a7
Showing
9 changed files
with
438 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/com/epam/aidial/core/data/CopySharedAccessRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.epam.aidial.core.data; | ||
|
||
public record CopySharedAccessRequest(String sourceUrl, String destinationUrl) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.epam.aidial.core.util; | ||
|
||
import com.epam.aidial.core.service.ResourceService; | ||
import com.epam.aidial.core.storage.BlobStorage; | ||
import com.epam.aidial.core.storage.ResourceDescription; | ||
import lombok.experimental.UtilityClass; | ||
|
||
@UtilityClass | ||
public class ResourceUtil { | ||
|
||
public static boolean hasResource(ResourceDescription resource, ResourceService resourceService, BlobStorage storage) { | ||
return switch (resource.getType()) { | ||
case FILE -> storage.exists(resource.getAbsoluteFilePath()); | ||
case CONVERSATION, PROMPT -> resourceService.hasResource(resource); | ||
default -> throw new IllegalArgumentException("Unsupported resource type " + resource.getType()); | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.