• 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
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Writing file from Unix to a Windows File Server

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a j2ee application running on a UNIX machine.
I need to write files to a windows file server share directory.

1) What would be the syntax for the URI or string to create a File\FileWriter\Writer?

so far I have tried:
new URI("file:///XXXFileServer/FolderA/FolderB/file.xml")
new URI("file:///XXXFileServer\\FolderA\\FolderB\\file.xml")
new FileWriter("\\\\XXXFileServer\\Folder\\FolderB\\file.xml")
new FileWriter("\\\\XXXFileServer/Folder/FolderB/file.xml")
which aren't correct.


new FileWriter("\\\\XXXFileServer\\Folder\\FolderB\\file.xml")
is correct if the code is running on an XP machine - but on the Unix it runs without throwing a FileNotFound error - but the file is not created.

2) So, my next question is - if the last line above is the correct syntax, and it is a user permissons error - is it possible to handle that in code or do I have to get a SysAdmin to open something up?

3) How can I handle folder names that have spaces in them?
[ December 22, 2004: Message edited by: Alex Beekman ]
 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure...I know on our network, we are sharing a Windows directory with Samba, and that's mapped to a drive on the Linux side...maybe you could set up a mapped drive on the Unix box that points to a drive/directory on the Windows machine.
 
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic