[Samba] Samba Share Mounts with Java

Udo Rader udo.rader at bestsolution.at
Fri Mar 28 00:14:19 GMT 2008


On Thu, 2008-03-27 at 12:66 -0600, josgreen at idoc.idaho.gov wrote:
> 
> >>> Udo Rader <udo.rader at bestsolution.at> 03/27/08 8:37 AM >>> 
> On Thu, 2008-03-27 at 08:05 -0600, josgreen at idoc.idaho.gov wrote:
> > Hello,
> > 
> >       I am developing a Java application that requires me to read
> from
> >  and write to a samba share. When developing in a windows
> environment
> >  this was not a problem. I mounted the share as "M:/", built a path
> to
> >  a file, checked if the file exists using the Java function
> >  file.exists(), and went on my merry way. Now I am developing in a
> >  Linux environment(SuSE 10). I mount the samba share to a folder and
> >  when I build the path it will find and display the image, however
> the
> >  check in Java(file.exists()) does not function properly. I ALWAYS
> get
> >  a return value of false. Any help with this issue would be
> >  appreciated. Thanks!!!

> Udo,
> 
> Thanks for taking a look at my issue. I used the following command to
> mount the share...
> 
> mount -t smbfs -o username=mediauser,password-med08cis
> //132.32.43.11/media
> /home/josgreen/tools/jakarto-tomcat-5.0.19/webapps/associate/media
> 
> file.getAbsolutePath - /media/associate/9782/facial/9782_f.jpg
> file.getPath - /media/associate/9782/facial/9782_f.jpg
> 
> As just another FYI I should also mention that I am running tomcat as
> my application server. Thanks again!

Hmm, your samba mount is in 

/home/josgreen/tools/jakarto-tomcat-5.0.19/webapps/associate/media

but the file you are looking for is in 

/media/associate/9782/facial/9782_f.jpg

so that cannot work at all.

Either mount your samba share like this

% mount -t smbfs -o username=mediauser,password-med08cis
//132.32.43.11/media /media

or correct the path of your file object

or maybe symlink the directory like this:

% ln
-s /home/josgreen/tools/jakarto-tomcat-5.0.19/webapps/associate/media /media

This is by no means a samba problem :-)

Please update your samba password now, because everybody on this list
knows it now :-)

-- 
Udo Rader

bestsolution.at EDV Systemhaus GmbH
http://www.bestsolution.at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.samba.org/archive/samba/attachments/20080328/84f20b27/attachment.bin


More information about the samba mailing list