X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Ffile%2Fprovider%2FCmsFileSystemProvider.java;h=602441e2fc3d3a3d8e8ecf64e749c3171e96582b;hb=eb8ade17be22103b314bf664e999185641fdcde0;hp=5d93b7b580ac5b51223f74d83f64b99b1189a71f;hpb=60bf0339227cc064a4ead694e3a699581a025233;p=lgpl%2Fargeo-commons.git 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 index 5d93b7b58..602441e2f 100644 --- a/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystemProvider.java +++ b/org.argeo.cms/src/org/argeo/cms/file/provider/CmsFileSystemProvider.java @@ -39,15 +39,14 @@ public class CmsFileSystemProvider extends FileSystemProvider { private ProvidedRepository contentRepository; - public void start() { - + } - + public void stop() { - + } - + @Override public String getScheme() { return "cms"; @@ -171,17 +170,23 @@ public class CmsFileSystemProvider extends FileSystemProvider { public void checkAccess(Path path, AccessMode... modes) throws IOException { } + @SuppressWarnings("unchecked") @Override public V getFileAttributeView(Path path, Class type, LinkOption... options) { - // TODO Auto-generated method stub + CmsPath cmsPath = (CmsPath) path; + if (BasicFileAttributes.class.isAssignableFrom(type)) + return (V) new ContentFileAttributeView(cmsPath.getContent()); + else if (ContentFileAttributeView.class.isAssignableFrom(type)) + return (V) new ContentFileAttributeView(cmsPath.getContent()); return null; } + @SuppressWarnings("unchecked") @Override public A readAttributes(Path path, Class type, LinkOption... options) throws IOException { - // TODO Auto-generated method stub - return null; + CmsPath cmsPath = (CmsPath) path; + return (A) new ContentAttributes(cmsPath.getContent()); } @Override