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 int m_port;
|
||||||
private String m_rootPath;
|
private String m_rootPath;
|
||||||
private ServerSocket m_serverSocket;
|
private ServerSocket m_serverSocket;
|
||||||
private char m_pathSeparator = '/';
|
|
||||||
|
|
||||||
public FileServer(int port, String rootPath)
|
public FileServer(int port, String rootPath)
|
||||||
{
|
{
|
||||||
m_port = port;
|
m_port = port;
|
||||||
m_rootPath = rootPath;
|
m_rootPath = rootPath;
|
||||||
if (rootPath.indexOf('\\') >= 0)
|
|
||||||
m_pathSeparator = '\\';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run()
|
public void run()
|
||||||
@ -64,7 +61,7 @@ public class FileServer implements Runnable
|
|||||||
|
|
||||||
/* read the file name the client is requesting */
|
/* read the file name the client is requesting */
|
||||||
String fileName = br.readLine();
|
String fileName = br.readLine();
|
||||||
String absFileName = m_rootPath + m_pathSeparator + fileName;
|
String absFileName = m_rootPath + File.separator + fileName;
|
||||||
|
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user