Example #1
0
        public DateTimeOffset GetFolderLastAccessTime(string path)
        {
            //Can happen...
            path = path.Trim();

            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            if (path.Length == 2)
            {
                if (path[1] == ':')
                {
                    return(new DateTimeOffset());
                }
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetFolderLastAccessTime(GetStorePath(path)));
        }
Example #2
0
        protected RscStore_Base GetStore(string sPath)
        {
            if (sPath.Length < 2)
            {
                return(null);
            }
            if (sPath[1] != ':')
            {
                return(null);
            }

            RscStore_Base store = null;

            switch (sPath[0])
            {
            case 'A':
            case 'a':
                store = new RscStore_IsoStore();
                break;

            case 'B':
            case 'b':
                store = new RscStore_KnownFolders();
                break;

            default:
                store = new RscStore_Storage();
                break;
            }

            store = store.GetSpecialStorage(GetStorePath(sPath));

            return(store);
        }
Example #3
0
        public RscStoreProperties GetFolderProperties(string path)
        {
            //Can happen...
            path = path.Trim();

            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            if (path.Length == 2)
            {
                if (path[1] == ':')
                {
                    return(new RscStoreProperties());
                }
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetFolderProperties(GetStorePath(path)));
        }
Example #4
0
        public DateTimeOffset GetFileLastAccessTime(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetFileLastAccessTime(GetStorePath(path)));
        }
Example #5
0
        public long GetFileLength(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                return(0);
            }

            return(store.GetFileLength(GetStorePath(path)));
        }
Example #6
0
        public RscStoreProperties GetFileProperties(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetFileProperties(GetStorePath(path)));
        }
Example #7
0
        public bool FileExists(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.FileExists(GetStorePath(path)));
        }
Example #8
0
        public System.IO.Stream GetReaderStream(string path, bool bForPreview = false)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetReaderStream(GetStorePath(path), bForPreview));
        }
Example #9
0
        public System.IO.Stream CreateFile(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.CreateFile(GetStorePath(path)));
        }
Example #10
0
        public void DeleteFile(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            store.DeleteFile(GetStorePath(path));
        }
Example #11
0
        public string GetOriginalFileNameOfPath(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetOriginalFileNameOfPath(GetStorePath(path)));
        }
Example #12
0
        //
        // //
        //

        public bool IsFolderImageOnly(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.IsFolderImageOnly(GetStorePath(path)));
        }
Example #13
0
        public bool FolderExists(string path)
        {
            //Can happen...
            if (path.Trim().Length == 0)
            {
                return(true);                                      //Holder of drives exists and walkable...
            }
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.FolderExists(GetStorePath(path)));
        }
Example #14
0
        public void CreateFolder(string path)
        {
            if (path[1] != ':')
            {
                throw new Exception("Not absolute path: " + path);
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            string sStorePath = GetStorePath(path);

            if (!store.FolderExists(sStorePath))                //Do not delete this... ...backward compatibility.
            {
                store.CreateFolder(sStorePath);
            }
        }
Example #15
0
        public string [] GetFolderNames(string path, string wildcard, bool bIncludeHidden = true, bool bStartWithInfChr = false)
        {
            //Can happen...
            path = path.Trim();

            //MUST NOT!!! Called to list drives...
            //if( searchPattern[ 1 ] != ':' ) throw new Exception( "Not absolute path: " + searchPattern );

            if (path.Length == 0)
            {
                return(GetRoots(bIncludeHidden, bStartWithInfChr));
            }

            RscStore_Base store = GetStore(path);

            if (store == null)
            {
                throw new Exception("Unknown store: " + path);
            }

            return(store.GetFolderNames(GetStorePath(path), wildcard, bIncludeHidden, bStartWithInfChr));
        }