Basic implementation of files API that allows other apps filesystem access
This commit is contained in:
27
files-api/pom.xml
Normal file
27
files-api/pom.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>nbs-cloud-aggregator</artifactId>
|
||||
<version>18-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>files-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.77zzcx7.nbs-cloud</groupId>
|
||||
<artifactId>web-container-registry</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,33 @@
|
||||
package de.nbscloud.files.api;
|
||||
|
||||
import de.nbscloud.webcontainer.registry.App;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface FilesService {
|
||||
record ContentContainer(boolean directory, Path path, String name, long size,
|
||||
LocalDateTime lastModified) {
|
||||
}
|
||||
|
||||
public void createAppDirectory(App app);
|
||||
|
||||
public void createDirectory(App app, Path path);
|
||||
|
||||
public void createFile(App app, Path path, byte[] content);
|
||||
|
||||
public void delete(App app, Path path);
|
||||
|
||||
public void get(App app, Path path);
|
||||
|
||||
/**
|
||||
* Paths in return list are always relative to the appDir.
|
||||
*
|
||||
* @param app to list the files for
|
||||
* @param path in case of {@link Optional#EMPTY} the appDir is used as start dir. If not empty, path has to be relative
|
||||
* to the appDir
|
||||
*/
|
||||
public List<ContentContainer> list(App app, Optional<Path> path);
|
||||
}
|
||||
Reference in New Issue
Block a user