Introduce CMS file system implementation
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 20 Jul 2022 09:36:27 +0000 (11:36 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 20 Jul 2022 09:36:27 +0000 (11:36 +0200)
org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileStore.java [new file with mode: 0644]
org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystem.java [new file with mode: 0644]
org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystemProvider.java [new file with mode: 0644]
org.argeo.cms/src/org/argeo/cms/file/provider/CmsPath.java [new file with mode: 0644]

diff --git a/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileStore.java b/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileStore.java
new file mode 100644 (file)
index 0000000..a4da893
--- /dev/null
@@ -0,0 +1,71 @@
+package org.argeo.cms.file.provider;
+
+import java.io.IOException;
+import java.nio.file.attribute.FileAttributeView;
+import java.nio.file.attribute.FileStoreAttributeView;
+
+import org.argeo.api.acr.fs.AbstractFsStore;
+
+public class CmsFileStore extends AbstractFsStore {
+
+       @Override
+       public String name() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public String type() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public boolean isReadOnly() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public long getTotalSpace() throws IOException {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       @Override
+       public long getUsableSpace() throws IOException {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       @Override
+       public long getUnallocatedSpace() throws IOException {
+               // TODO Auto-generated method stub
+               return 0;
+       }
+
+       @Override
+       public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean supportsFileAttributeView(String name) {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Object getAttribute(String attribute) throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+}
diff --git a/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystem.java b/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystem.java
new file mode 100644 (file)
index 0000000..6d4eea2
--- /dev/null
@@ -0,0 +1,100 @@
+package org.argeo.cms.file.provider;
+
+import java.io.IOException;
+import java.nio.file.FileStore;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.nio.file.WatchService;
+import java.nio.file.attribute.UserPrincipalLookupService;
+import java.nio.file.spi.FileSystemProvider;
+import java.util.Set;
+
+import org.argeo.api.acr.fs.AbstractFsSystem;
+
+public class CmsFileSystem extends AbstractFsSystem<CmsFileStore> {
+
+       @Override
+       public CmsFileStore getBaseFileStore() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public CmsFileStore getFileStore(String path) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public FileSystemProvider provider() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void close() throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public boolean isOpen() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean isReadOnly() {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public String getSeparator() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Iterable<Path> getRootDirectories() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Iterable<FileStore> getFileStores() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Set<String> supportedFileAttributeViews() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Path getPath(String first, String... more) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public PathMatcher getPathMatcher(String syntaxAndPattern) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public UserPrincipalLookupService getUserPrincipalLookupService() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public WatchService newWatchService() throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+}
diff --git a/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystemProvider.java b/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystemProvider.java
new file mode 100644 (file)
index 0000000..51eb84e
--- /dev/null
@@ -0,0 +1,133 @@
+package org.argeo.cms.file.provider;
+
+import java.io.IOException;
+import java.net.URI;
+import java.nio.channels.SeekableByteChannel;
+import java.nio.file.AccessMode;
+import java.nio.file.CopyOption;
+import java.nio.file.DirectoryStream;
+import java.nio.file.DirectoryStream.Filter;
+import java.nio.file.FileStore;
+import java.nio.file.FileSystem;
+import java.nio.file.LinkOption;
+import java.nio.file.OpenOption;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileAttribute;
+import java.nio.file.attribute.FileAttributeView;
+import java.nio.file.spi.FileSystemProvider;
+import java.util.Map;
+import java.util.Set;
+
+public class CmsFileSystemProvider extends FileSystemProvider {
+
+       @Override
+       public String getScheme() {
+               return "cms";
+       }
+
+       @Override
+       public FileSystem newFileSystem(URI uri, Map<String, ?> env) throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public FileSystem getFileSystem(URI uri) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Path getPath(URI uri) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)
+                       throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public DirectoryStream<Path> newDirectoryStream(Path dir, Filter<? super Path> filter) throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public void delete(Path path) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public void copy(Path source, Path target, CopyOption... options) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public void move(Path source, Path target, CopyOption... options) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public boolean isSameFile(Path path, Path path2) throws IOException {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public boolean isHidden(Path path) throws IOException {
+               // TODO Auto-generated method stub
+               return false;
+       }
+
+       @Override
+       public FileStore getFileStore(Path path) throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void checkAccess(Path path, AccessMode... modes) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+       @Override
+       public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options)
+                       throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public Map<String, Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException {
+               // TODO Auto-generated method stub
+
+       }
+
+}
diff --git a/org.argeo.cms/src/org/argeo/cms/file/provider/CmsPath.java b/org.argeo.cms/src/org/argeo/cms/file/provider/CmsPath.java
new file mode 100644 (file)
index 0000000..504e69b
--- /dev/null
@@ -0,0 +1,25 @@
+package org.argeo.cms.file.provider;
+
+import org.argeo.api.acr.fs.AbstractFsPath;
+
+public class CmsPath extends AbstractFsPath<CmsFileSystem, CmsFileStore> {
+
+       public CmsPath(CmsFileSystem filesSystem, CmsFileStore fileStore, String[] segments, boolean absolute) {
+               super(filesSystem, fileStore, segments, absolute);
+       }
+
+       public CmsPath(CmsFileSystem filesSystem, String path) {
+               super(filesSystem, path);
+       }
+
+       @Override
+       protected AbstractFsPath<CmsFileSystem, CmsFileStore> newInstance(String path) {
+               return new CmsPath(getFileSystem(), path);
+       }
+
+       @Override
+       protected AbstractFsPath<CmsFileSystem, CmsFileStore> newInstance(String[] segments, boolean absolute) {
+               return new CmsPath(getFileSystem(), getFileStore(), segments, absolute);
+       }
+
+}