use File.separator instead of figuring it out ourselves
git-svn-id: svn://anubis/gvsu@42 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
dd3204530f
commit
0010b52177
@ -8,14 +8,11 @@ public class FileServer implements Runnable
|
||||
private int m_port;
|
||||
private String m_rootPath;
|
||||
private ServerSocket m_serverSocket;
|
||||
private char m_pathSeparator = '/';
|
||||
|
||||
public FileServer(int port, String rootPath)
|
||||
{
|
||||
m_port = port;
|
||||
m_rootPath = rootPath;
|
||||
if (rootPath.indexOf('\\') >= 0)
|
||||
m_pathSeparator = '\\';
|
||||
}
|
||||
|
||||
public void run()
|
||||
@ -64,7 +61,7 @@ public class FileServer implements Runnable
|
||||
|
||||
/* read the file name the client is requesting */
|
||||
String fileName = br.readLine();
|
||||
String absFileName = m_rootPath + m_pathSeparator + fileName;
|
||||
String absFileName = m_rootPath + File.separator + fileName;
|
||||
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user