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
asterisk
model-view-controller
ftp
cluster-analysis
dronekit
conceptual
mifare
watson-iot
symfony-sonata
psexec
travis-ci-cli
kendo-asp.net-mvc
collision-detection
python-3.4
qt4
browserstack
virtualhost
ionic-native
phpexcel
rename
mamp
cakephp-2.0
derby
minimum
hql
box2d
taxonomy
simd
ringcentral
google-street-view
monad-transformers
aws-iot
oracle-golden-gate
typeorm
pypy
semantic-ui-react
paper-trail-gem
ibm-bpm
ng2-bootstrap
restler
tunnel
repeat
gstreamer-1.0
mtm
ear
intermediate-language
webmatrix
pyautogui
group
nls
symantec
dimensionality-reduction
require-handlebars
csc
gdi
db2-zos
avaudiorecorder
dcast
nslocalizedstring
yfiles
maven-antrun-plugin
webservices-client
android-filterable
sparkcore
vectordrawable
fileinputstream
attiny
cordova-3
api-eveonline
powershell-v1.0
rpt
disabled-control
triplestore
amzi-prolog
nspopupbutton
cs193p
episerver-7
lettuce
facebook-java-api
lastinsertid
zend-db-table
dynamic-expresso
uikit-dynamics
coinbase-php
ntdll
database-restore
ios6-maps
optimistic-concurrency
advanceddatagrid
stl-algorithm
log-shipping
backlight
mismatch
sessiontracking
nbehave
subdirectories
chromebug
miniport
konsole

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