public void Init()
        {
            //Init...
            _sys     = new StandardFileSystem();
            _sys     = StandardFileSystem.Create("FSROOT");
            _service = new FilesWebService(_sys);
            _request = new CS422.WebRequest();
            _root    = _sys.GetRoot();

            //Set up the filesystem
            //Create Files
            FileStream file = File.Create(_rootPath + "/file1");
            String     s    = "this is a file with content";

            byte[] buffer = Encoding.ASCII.GetBytes(s);
            file.Write(buffer, 0, s.Length);
            file.Close();
            File.Create(_rootPath + "/file2").Close();

            //Create Directory
            Directory.CreateDirectory(_rootPath + "/Dir1");

            //Create subDirs
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir2");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1/DoubleSubDir1");

            //Create subFiles
            File.Create(_rootPath + "/Dir1/subfile1").Close();
            File.Create(_rootPath + "/Dir1/SubDir1/doubleSubFile1").Close();

            Console.WriteLine("Setup Complete");
        }
        public void Init()
        {
            //Init...
            _sys     = new StandardFileSystem();
            _sys     = StandardFileSystem.Create("FSROOT");
            _service = new FilesWebService(_sys);
            _request = new CS422.WebRequest();

            //Set up the filesystem
            //Create Files
            File.Create(_rootPath + "/file1").Close();
            File.Create(_rootPath + "/file2").Close();

            //Create Directory
            Directory.CreateDirectory(_rootPath + "/Dir1");

            //Create subDirs
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir2");
            Directory.CreateDirectory(_rootPath + "/Dir1/SubDir1/DoubleSubDir1");

            //Create subFiles
            File.Create(_rootPath + "/Dir1/subfile1").Close();
            File.Create(_rootPath + "/Dir1/SubDir1/doubleSubFile1").Close();

            Console.WriteLine("Setup Complete");
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            var x = StandardFileSystem.Create("/home/jay/422/HW9Test");
            var y = new FilesWebService(x);

            WebServer.AddService(y);
            WebServer.Start(4220, 10);
        }
Exemple #4
0
        public static void Main(string[] args)
        {
            WebServer.AddService(new FilesWebService(StandardFileSystem.Create("root")));

            WebServer.Start(3000, 10);

            WebServer.Stop();
        }
Exemple #5
0
        public void GetParentS()
        {
            FileSys422 fileSystem = StandardFileSystem.Create(good_path);
            Dir422     root       = fileSystem.GetRoot();
            Dir422     dir        = root.GetDir("d6");

            Assert.AreEqual("files", dir.Parent.Name);
        }
Exemple #6
0
        public void AbsolutePathRootS()
        {
            FileSys422 fileSystem = StandardFileSystem.Create(good_path);

            Dir422 root = fileSystem.GetRoot();

            string absolutePath = Utility.AbsolutePath(root);

            Assert.AreEqual("/files", absolutePath);
        }
Exemple #7
0
        static void Main(string[] args)
        {
            Console.WriteLine("WebServer starting...");
            WebServer.Start(4220, 60);

            WebServer.AddService(new FilesWebService(StandardFileSystem.Create(@"C:\Users\Luke\Desktop\100GOPRO")));
            Console.ReadLine();

            WebServer.Stop();
        }
Exemple #8
0
        public static void Main(string[] args)
        {
            StandardFileSystem t = StandardFileSystem.Create("/Users/jared/Webserver_files");

            WebServer.AddService(new FilesWebService(t));
            WebServer.AddService(new WebPageService());
            WebServer.Start(1130, 100);


            while (true)
            {
            }
        }
Exemple #9
0
        public void AbsolutePathRegS()
        {
            FileSys422 fileSystem = StandardFileSystem.Create(good_path);

            Dir422 root = fileSystem.GetRoot();

            Dir422 dirD6 = root.GetDir("d6");

            Dir422 dirD7 = dirD6.GetDir("d7_l2");

            string absolutePath = Utility.AbsolutePath(dirD7);

            Assert.AreEqual("/files/d6/d7_l2", absolutePath);
        }
Exemple #10
0
        //WebServer server = new WebServer();
        public static void Main(string[] args)
        {
            const string goodPath =
                "/home/zak/Repos/CS422/HW9/CS422/files";

            DemoService test = new DemoService();

            StandardFileSystem myFileSystem = StandardFileSystem.Create(goodPath);

            FilesWebService hostedFiles = new FilesWebService(myFileSystem);

            WebServer.AddService(hostedFiles);

            WebServer.Start(2017, 22);
        }
Exemple #11
0
        public void Init()
        {
            StandardFileSystem sys = new StandardFileSystem();

            sys   = StandardFileSystem.Create("FSROOT");
            _root = (StdFSDir)sys.GetRoot();

            File.Create(_rootPath + "/file1").Close();
            Directory.CreateDirectory(_rootPath + "/Dir1");
            Directory.CreateDirectory(_rootPath + "/Dir1" + "/SubDir1");
            File.Create(_rootPath + "/Dir1/subfile1").Close();

            Console.WriteLine("Setup Complete");
            Console.WriteLine("Root: " + _root);
        }
Exemple #12
0
 public void Init()
 {
     WebServer.AddService(new FilesWebService(StandardFileSystem.Create("root")));
     WebServer.Start(PORT, 10);
 }
Exemple #13
0
 public void Inti()
 {
     _sys = new StandardFileSystem();
     _sys = StandardFileSystem.Create("FSROOT");
 }
Exemple #14
0
        public void StdFSCreateF()
        {
            StandardFileSystem obj = StandardFileSystem.Create(bad_path);

            Assert.Null(obj);
        }
Exemple #15
0
        //
        public void StdFSCreateS()
        {
            StandardFileSystem obj = StandardFileSystem.Create(good_path);

            Assert.NotNull(obj);
        }
Exemple #16
0
        public void RootParentNull()
        {
            StandardFileSystem root = StandardFileSystem.Create(good_path);

            Assert.IsNull(root.GetRoot().Parent);
        }