Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

"#" sysmbol causing problem in downloading

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a applet class for downloading a drawing files from a unix server to a local NT box. It downloads the files well. But when the file contains "#" symbol in its name, it is not downloading the file... instead it is downloading some .jsp files instead of the drawing file. I would like to know whether "#" is a illegal character to java.
I have attached a part of the code here
----------------------------------------------------------------
sErrorTextField.setText("downloading files . . .");
StringTokenizer stringtokenizer = new StringTokenizer(sFileNameList, "|");
for(StringTokenizer stringtokenizer1 = new StringTokenizer(sBusIdList, "|"); stringtokenizer1.hasMoreTokens()
{
sFileName = stringtokenizer.nextToken();
sBusId = stringtokenizer1.nextToken();
String s = "/servlet/filedownload/" + sBusId + "?filenameformat=" + sFileName;
URL url = new URL(getDocumentBase().toString());
URL url1 = new URL(url.getProtocol(), url.getHost(), url.getPort(), s);
URLConnection urlconnection = url1.openConnection();
urlconnection.setDoInput(true);
urlconnection.setRequestProperty("Cookie", "WebLogicSession=" + inputSessionID);
InputStream inputstream = urlconnection.getInputStream();
String s2 = sClientLocation + "/" + sFileName;
sTextArea.append("Checked Out " + sFileName + "\n");
FileOutputStream fileoutputstream = null;
fileoutputstream = new FileOutputStream(s2);
byte abyte0[] = new byte[1000];
int i;
while((i = inputstream.read(abyte0)) > -1)
fileoutputstream.write(abyte0, 0, i);
inputstream.close();
fileoutputstream.close();
if(!running)
{
sErrorTextField.setText("download stopped ...");
break;
}
}
-------------------------------------------------
Thanks in Advance
chari
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lokachari P J,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic