Hi,
I use ServerSocket to connect to the remote server.
My program is not a web application so I am not using tomcat.
It just FTP the file to local machine. Is there a way to search
for the file by ignoring the filename case-sensitivity?
Thanks.
Below are part of my codes:
/* @param dataSocket: The serverSocket created at local machine.
* @param pfilename: Remote file name
* @param pdestPath: Remote directory name
*/
private void getRemoteFile(ServerSocket dataSocket,
String pfilename,
String pdestPath) throws IOException, FTPException
{
try
{
initializeGet(pfilename);
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(
pdestPath + File.separator + pfilename, false));
DataInputStream in = new DataInputStream(dataSocket.accept()
.getInputStream());
byte[] buffer = new byte[chunkSize];
int len = 0;
while ((len = in.read(buffer, 0, chunkSize)) > 0)
{
out.write(buffer, 0, len);
}
out.flush();
out.close();
in.close();
dataSocket.close();
}
}