jcifs


Jcfis jcifs.smb.SmbException: Access is denied


i have a problem when i try to move a file to a shared folder in win xp.
My code is the next
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileOutputStream;
import java.io.File;
import java.io.FileInputStream;;
public class UnidadRed {
//public static void main(File enviado) throws Exception {
public static void main(String arg[]) throws Exception {
String enviado = "C:\\Documents and Settings\\u2d8301\\Escritorio\\probando\\estadisticas.txt";
String salida = "smb://172.22.224.64/Color";
//Config.setProperty("jcifs.smb.client.domain", "NTDOMAIN");
Config.setProperty( "jcifs.smb.client.username", "name");
Config.setProperty( "jcifs.smb.client.password", "password");
//Config.setProperty( "jcifs.netbios.wins", "172.22.224.64");
System.out.println("Copiando fichero ''" + enviado + "'' a ''" +salida + "''");
try {
FileInputStream in = new FileInputStream(enviado);
SmbFileOutputStream out = new SmbFileOutputStream(salida);
byte[] buf = new byte[1024 * 16];
int len, total=0;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
total+=len;
}
in.close();
out.close();
System.out.println(total + " bytes copiados.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
I try to move a txt to a folder that will print automatically the file, when i execute appears the next failures:
Copiando fichero ''C:\Documents and Settings\u2d8301\Escritorio\probando \estadisticas.txt'' a ''smb://172.22.224.64/Color''
jcifs.smb.SmbException: Access is denied.
at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563)
at jcifs.smb.SmbTransport.send(SmbTransport.java:663)
at jcifs.smb.SmbSession.send(SmbSession.java:238)
at jcifs.smb.SmbTree.send(SmbTree.java:119)
at jcifs.smb.SmbFile.send(SmbFile.java:775)
at jcifs.smb.SmbFile.open0(SmbFile.java:989)
at jcifs.smb.SmbFile.open(SmbFile.java:1006)
at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:82)
at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:54)
at apliSep.UnidadRed.main(UnidadRed.java:25)
I put correctly the name and password, because if a try a non valid login/password apperas a different message.
The my question is:
Is it neccesary other parametres in config.setProperty?
Thank you for all.
I think your problem was solved here.You can't create a SmbFileInputStream for a directory, so take a look at the link and change SmbFileInputStream for SmbFile.

Related Links

NTLMv2 JCIFS password hash
jcifs.smb.SmbException: The parameter is incorrect
jcifs share enumartion timesout
Jcfis jcifs.smb.SmbException: Access is denied
How can you tell where a particular instance of JCIFS is running?

Categories

HOME
asp.net
mobile
service
cluster-analysis
watson-iot
mailchimp
sdk
perl6
psexec
aggregate-functions
cdn
handlebars.js
google-api-oauth
obd-ii
urllib2
solidity
http-status-codes
jetbrains
javascript-debugger
tag-cloud
dompdf
filehelpers
openam
jquery-easyui
google-calendar-api3
restructuredtext
combinations
rndis
onclicklistener
quality-center
grunt-contrib-uglify
oracle10g
sasl
tftp
drombler-fx
foxpro
akamai
visual-prolog
leaderboard
campaign-monitor
mongoid5
keychain
mixed-models
rbac
compiled-query
contenteditable
datagridviewcombobox
colorbox
peerjs
ng-class
beanshell
openidm
extjs3
riemann
sharpdevelop
typewriter
blackberry
suitesparse
stripes
firebase-polymer
distcc
mongodb-3.3
symantec
networkstream
supervised-learning
boost-propertytree
android-progressbar
wizard
wonderware
angular-promise
ruby-1.8.7
eula
targetprocess
screen-lock
pymol
powerpoint-2010
worklight-appcenter
cs193p
scidb
asp.net-4.0
dd4t
select2-rails
cocotron
bho
nx
architectural-patterns
teamsystem
sup
dancer
django-1.4
animationdrawable
mcpd
file-processing
jqtransform
designated-initializer
datarelation
miniport
mysql-pconnect
wtsapi32
moores-law

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App