public RobotFileSystemManager(HostingRobotProxy hostingProxy , int maxQuota, string writableRootDirectory, string readableRootDirectory)
        {
            this.hostingProxy = hostingProxy;
            this.maxQuota = maxQuota;
            this.writableRootDirectory = Path.GetFullPath(writableRootDirectory);
            this.readableRootDirectory = Path.GetFullPath(readableRootDirectory);

            if (Directory.Exists(writableRootDirectory))
            {
                var di = new DirectoryInfo(writableRootDirectory);
                foreach (FileInfo file in di.GetFiles())
                {
                    usedQuota += file.Length;
                }
            }
        }
Beispiel #2
0
 private static void CreateProxy()
 {
     if (specification.isTeamRobot())
     {
         robotProxy = new TeamRobotProxy(specification, hostManager, robotPeer, statics);
     }
     else if (specification.isAdvancedRobot())
     {
         robotProxy = new AdvancedRobotProxy(specification, hostManager, robotPeer, statics);
     }
     else if (specification.isStandardRobot())
     {
         robotProxy = new StandardRobotProxy(specification, hostManager, robotPeer, statics);
     }
     else if (specification.isJuniorRobot())
     {
         robotProxy = new JuniorRobotProxy(specification, hostManager, robotPeer, statics);
     }
     else
     {
         throw new AccessViolationException("Unknown robot type");
     }
 }