Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Case-sensitive of filename

 
harry flower
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wish to download a text file from a remote server.
As Unix is case-sensitive, is it possible to download a file
regardless of the case-sensitivity of its filename?
That means if the server store this file named "ABC.TXT",
so even if I input "abc.txt", I can still download the file.

Thanks to advise if you have some solution.
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends. You don't tell us HOW you are downloading the file (Tell The Details). For example, if you were using HTTP to contact a Tomcat web server, there's a switch in the context configuration that lets you turn off case sensitivity.
 
harry flower
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
}
}
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not aware of any way to do case-insensitive FTP. You may want to check the documentation of your particular FTP server to see if there is an option.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!