• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Case-sensitive of filename

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If you're gonna buy things, buy this thing and I get a fat kickback:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic