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
excel-formula
kendo-ui
macros
customization
apache-storm
reference
data-modeling
crm
redhawksdr
hiveql
ms-application-insights
multipartform-data
genexus
subprocess
phpexcel
dynamics-crm-2011
chef-recipe
console-application
exchange-transport-agents
appsettings
taxonomy
jquery-easyui
alert
geography
jq
hololens
matlab-gui
jira-zephyr
rancher
workflow-foundation
uibarbuttonitem
request-uri
pushpad
boost-log
lines
key-bindings
circle
ports
favorites
flickr
apache-falcon
ragel
gstreamer-1.0
realloc
rtsp
mapquest
mockserver
redbean
jquery-ui-slider
uitextview
result
servicebus
mef
easyquery
ng-class
vertex
fluent-nhibernate-mapping
xamarin-test-cloud
copy-constructor
firebase-job-dispatcher
magick.net
recurring
hfp
patching
django-celery
laterjs
sqlxml
matlab-engine
overlapping
serial-communication
self-join
lytro
personality-insights
tess4j
pdcurses
firewire
euro
opennebula
bungeecord
wingdb
jad
esri-arc-engine
shunting-yard
fedena
xmlserializer
yosemite
amzi-prolog
mvcgrid
ant-contrib
nvcc
randomaccessfile
google-oauth-java-client
grape-api
pechkin
violation
azure-pack
maven-webstart-plugin
asp.net-4.0
exi
coinbase-php
gmail-imap
rfc822
linear-interpolation
expresso-store
ios6-maps
socketasynceventargs
idtabs
method-call
designated-initializer
mysql-pconnect
qlibrary

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