/** * Returns the Physical Path * * @param sMyWebServerRoot Web Server Root Directory * @param virtualDir Virtual Directory * @return Physical local Path * @throws IOException */ @Override public String getLocalPath(String virtualDir) throws IOException { File vDirs = new File(ServerCore.ServerCongiguration.WebApplication.Root + "Data\\VDirs.dat"); FileReader fileReader; BufferedReader reader; String line = ""; String fileVirtualDir = ""; String fileRealDir = ""; int iStartPos = 0; virtualDir = virtualDir.trim(); // sMyWebServerRoot = sMyWebServerRoot.ToLower(); // virtualDir = virtualDir.ToLower(); // sDirName = sDirName.Substring(1, sDirName.Length - 2); fileReader = new FileReader(vDirs); reader = new BufferedReader(fileReader); while (reader.ready()) { line = reader.readLine(); line.trim(); if (line.length() > 0) { iStartPos = line.indexOf(";"); line = line.toLowerCase(); fileVirtualDir = line.substring(0, iStartPos); fileRealDir = line.substring(iStartPos + 1); if (fileVirtualDir.equals(virtualDir)) { break; } } } ServerCore.print("Virtual Dir : " + fileVirtualDir); ServerCore.print("Directory : " + virtualDir); ServerCore.print("Physical Dir: " + fileRealDir); if (fileVirtualDir.equals(virtualDir)) return fileRealDir; else return virtualDir; }
public ServerConnection getConnection() { for (ServerConnection connection : ServerCore.instance().connections.values()) { if (connection.user != null) { if (connection.user.username == username) { return connection; } } } return null; }
public User(String name, ArrayList<String> message) { username = name; messages = message; ServerCore.instance().cachedUsers.put(username, this); }