Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating new file with JCIFS

807580May 15 2010 — edited May 15 2010
Hello everybody,

Sorry for my poor english but I'm French :-).

I want to copy a file from my computer (locally) to a SMB share but unfortunately It fails and I don't know why. I've got an exception "Access Denied" despite the SMB share is on full control for Everyone.
I also write file.canWrite() and the return is true !
Finally I can alors create directories as I want....

Could you tell me what I did wrong in the code below ? (in fact I can succefully logon on the SMB share)
private void copyFile(File from, SmbFile shareTo) throws Exception {
        FileInputStream in = new FileInputStream( from );
        SmbFileOutputStream out = new SmbFileOutputStream(shareTo);

        byte[] b = new byte[8192];
        int n, tot = 0;
        while(( n = in.read( b )) > 0 ) {
            out.write( b, 0, n );
        }
        in.close();
        out.close();
	}
Is it JCIFS that cannot do such that things ?

Thanks !
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 12 2010
Added on May 15 2010
1 comment
413 views