commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jurado, Benjamin - BLS CTR" <Jurado.Benja...@bls.gov>
Subject Commons-net
Date Fri, 16 Dec 2005 20:06:36 GMT
Hello

I am trying to set a permissions on a file using the following code:
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(user,passwd);
ftp.changeWorkingDirectory(dir);

boolean ftpResults = ftp.sendSiteCommand("chmod 0770 " +file); //tried
chmod 770 

ftp.site("chmod 770"); //also failed.
The ftpResults return true. But when I check the permission on the Unix
server the remain the same.

Have also tried 

ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.READ_PERMISSION,tr
ue);
ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.WRITE_PERMISSION,t
rue);
ftpFiles[i].setPermission(FTPFile.USER_ACCESS,FTPFile.EXECUTE_PERMISSION
,true);

Is there a ftp library that allows this action?
This has also failed....
Thanks
Benjamin Jurado


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message