Change file access in FTP

Hi, i'm new in java and i'm trying to make a program that moves a file to a FTP server, I already made that part of the program.
but i'm having problems finding the way of change the access of the file, when was already moved it.
This is an example of the code that i'm using to do the first part.
import java.io.*;
import java.net.*;
import java.util.*;
public class FTPConnection {
public boolean connect(String host)
throws UnknownHostException, IOException
return connect(host, 21);
public boolean login(String username, String password)
throws IOException
int response = executeCommand("user " + username);
if (!isPositiveIntermediateResponse(response)) return false;
response = executeCommand("pass " + password);
loggedIn = isPositiveCompleteResponse(response);
return loggedIn;
public boolean uploadFile(String serverPath, String localPath)
throws IOException
return writeDataFromFile("stor " + serverPath, localPath);
public boolean changeDirectory(String directory)
throws IOException
int response = executeCommand("cwd " + directory);
return isPositiveCompleteResponse(response);
I already have the code to take the file and move it to the server but i can't find the way to change the access.
I hope someone can help me with this thanks.

I already tried to use chmod but it doesn't work this is the example that i made
public boolean changePermissions(String Path)
throws IOException
int response = executeCommand("chmod 777 " + Path);
return isPositiveCompleteResponse(response);
but the file continue with the same permission. So i was wondering if i'm doing something wrong or is other way to do it.
Thanks for your help

Similar Messages

  • How do I stop DW CS6 randomly changing file permissions via FTP?

    How do I stop Dreamweaver CS6 12.0.1.5842 randomly changing file permissions when it uploads files to my web server via FTP.
    I can no longer trust Dreamweaver to upload websites correctly as it changes permissions on some files which then deny the server access to the file which in turn makes the webpage unreachable/return a 403 error.
    This is driving me insane.
    I'm using an early 2011 Macbook Pro 10.7.5.

    Hi,
    I'm having this problem too. Has Adobe fixed the issue yet? This appears to be an Adobe problem, not all the web hosts out there. CS6 is ramdomly (meaning: not every time) changing permissions on files uploaded with it and is not usable for web work until this problem is fixed by Adobe or a solution is provided. If I wanted to use a separate FTP program I would not have recommended that my employer buy multiple Adobe CS6 product licenses. One of the primary appeals of DW is the integration of FTP into the workflow.
    I am using a destop iMac2.8 GHz Intel Core 2 Duo, 4 gigs of 800 MHz DDR2 SDRAM.
    OSX 10.7.5
    I am using DW Version 12 Build: 5808
    Dreamweaver CS4 that I was using until this new purchase was working just fine. No file permisssion changes. I am being forced to go back to using it until Adobe posts a fix for this.
    I should ask while I'm here: has anyone found a solution for this yet?
    Thanks,
    -c-

  • Changing File Permissions via FTP for WordPress

    Hi,
    I access files for a WordPress installation via FTP and when I try to change permissions to some files for some plugins compatibility issues I get the error below and the permissions are not applied.
    SITE CHMOD 747 colors.css
    Response: 500 'SITE': command not understood
    Best Regards,
    Abby Doc

    Hello Abby,
    Thanks for posting here.
    I would like to know how you're trying to change File permissions. Is that by using FileZilla or something?
    I would suggest you to refer the below links.
    Related Thread:
    http://social.msdn.microsoft.com/Forums/windowsazure/en-US/50e94a19-066b-443e-a70a-4fe3d99a6e95/how-to-set-file-permissions?forum=windowsazurewebsitespreview
    http://wordpress.org/support/topic/chmod-aka-file-permissions
    Steps to change a directories File Permissions using FileZilla FTP.
    Stop your website from the management console (https://manage.windowsazure.com)
    Open up the FTP site in Filezilla
    Rename the directory that has the problem
    Restart your website.
    I hope that helps.
    Best Regards,
    Sadiqh Ahmed

  • Changing file access

    hi ,
    how to change read only access file to writable file ?????

    Permission objects (e.g. FilePermission) are
    immutable. I don't know of any way within the 5.0
    JVM/core classes to change file permissions.So I guess the only way I can think of is by using Runtime.exec() and run the command for the specific platform you're on (e.g. chmod on unix/linux) to change the rights. Not a nice solution though.

  • Changing file access permissions?!

    I have a MacBook Pro retina running os x mountain lion, if that helps any of you guys answer this question. I recently took a screenshot of an area of the screen using the command-shift-4 combination. When i was trying to open it, though, an  error came up saying that i didnt have the permission to open the file. It told me to got to get info and change file permissions.
    How do I change file permissions and why does it say this in the first place??
    Thanks,
    RZ

    Doing a screen shot creates a file on the users desktop which they should already have permission to use.
    So if it's saying you don't means there is something else wrong with your machine.
    Do these to things first.
    1: #6 Repair Users Permissions (this will fix the in user folder permissions)
    2: #12 OnyX (free) cache cleaning and will repair OS X permissions.
    ..Step by Step to fix your Mac
    What is basically going to happen is your going to reset the permissions of all files on the machine back to what they should be and not what something caused it to become off.
    Doing all the OnyX steps in Maintainence and Cleaning is going to reset everything else in the system like caches etc., so it's like it just came from the factory which will cause those caches to rebuild anew and free of corruption that might have occured.
    OnyX also has flags as it checks the drive for other issues, thus gives you a warning of other potential problems.
    Make sure you have backups of your users files off the machine to a storage drive (not only TimeMachine) before you atempt any repairs as all the remaining software can be replaced except your files in case it turns out your problem is much larger than anticipated.
    Most commonly used backup methods

  • Change file access date

    Anyone know how to change a file's access date? There is setLastModified() in the File class but I don't see anything for access date.

    a\Access date is just the date you last opened it. To set it, you can open it, and it will set it to todays date.

  • Change file access

    Hello, how can I set access for /dev/console if I want to work with it as regular user.
    I tried different arguments for chmod (a+rw in main), but after reloading it resets.
    $ ls -l /dev/console
    crw------- 1 root root 5, 1 Jan 14 20:44 /dev/console
    What is the right way to change acces for that file?
    $ groups
    wheel network video audio optical floppy storage camera users
    Last edited by Ockonal (2011-01-14 19:09:00)

    Ockonal wrote:moetunes, okay, but anyway I can't edit it with regular user even before reloding computer.
    I did
    sudo chmod -v a+rw /dev/console
    and now permissions are
    crw-rw-rw- 1 root root 5, 1 Jan 14 15:45 /dev/console
    do your permissions change but you still can't write to it or do they not change at all?

  • Change in file permission in ftp adapter

    Hi All,
    I am facing a problem in ftp adapter. I have a text file with 777 permissions when i am moving the file with ftp adapter(FTPMove operation to another folder file permissions are getting changed to 644. But if i move the file using command prompt permissions are same. The server is unix machine.
    Can anyone plz tell me that how the files can be moved with same permissions using ftp adapter. i m using jdeveloper11.1.1.4.0. and soa11g.
    Thanks in advance,
    Sourbh

    Actually i use File Zilla client for file move and my question is that Is there a way that ftp adapter dont change file permissions while moving a file from one directory to another directory.

  • Changing oracle file permission with ftp / sql

    Hi, i have a question:
    I've configure webdav to browse my /i folder.
    I can use as well filezilla, connecting with hostname / uname: system / pass / myoraclesystem pass.
    Is there a way to change file permission attributes with ftp?
    Thank you

    Hi,
    Check out ORDSYS.ORDImage type from Oracle Intermedia, and especially its "process" method.
    It possesses various commands to change image properties.
    HTH.

  • After change the file access option 'No Access', I cannot start up my iMac. Only blue screen!

    Hi experts,
    I really need help.
    I have several user accounts in my iMac G5.
    Some reason - I don't know why I did - I went into the 'get info' of the Mac hard drive, and change the permission to the hard drive from 'Read and Write' 'to 'No Access' for the one of the user accounts.
    After that, I switched the user as the one I just changed 'No Access'. But I couldn't do any action in that user space, like opening finder, starting any program.
    So I re-started the computer and since then, I only see the blue screen (no arrow no nothing.).
    I tried booting with Safe Mode, but still only show blue screen.
    I tried booting with single user mode, still blue screen.
    I can start up with the disk but couldn't restore the HD since there is no time point at all that I can go back.
    What should I do? Please help me~

    I tried booting with single user mode, still blue screen.
    Changing permissions an a user account should not cause single user mode to fail.  You changed permissions on something else. Could you provide more info on the folder you changed?
    Some reason - I don't know why I did - I went into the 'get info' of the Mac hard drive, and change the permission to the hard drive from 'Read and Write' 'to 'No Access' for the one of the user accounts.
    This is a little confusing.  We need to know what folder you changed.
    You might try Disk Utility repair permissions. Here is how to get into Disk Utility from the startup disk.
    You can also get into the Terminal. Notice terminal is on the pull down. Check permissions on the root directory
    mac $ ls -ld /
    drwxrwxr-t   51 root  admin    1K Dec 31  1969 /
    mac $
    verify & repair your startup drive
    To verify & repair you file system on the startup drive, you will need to run disk utility from you installation DVD.
    This article  will tell you how to get to disk utility.  Once in a disk utility, you can go and attempt to recover the disk.
    http://support.apple.com/kb/TS1417
    To repair your startup drive, you will need to run disk utility from your startup DVD.
    Mac OS X 10.4: About the utilities available on the Mac OS X 10.4 Install DVD
    http://support.apple.com/kb/HT2055
    How to run disk utility from your startup DVD.
    Insert your  startup DVD  into your reader.  Power down your machine.  Hold down to the c key.  Power on your machine.  This will bootup your startup DVD.
    This will bring you to a panel asking you for your language.  Pick your language.
    You you come to the Install Mac OS panel.  Do not install.
    Click on Utilities menu item.  This will give you a pulldown list of utilities.
    Click on the disk utility.
    You are now in disk utility.  Pick your disk.  Click on repair it should be on the lower right of the panel.
    Once the repair completes successfully, you should update your permissions.
    Verify a disk
    As an alternative, you can verify that the filesystem on the disk is correct. You will not be able to repair the file system.
    I suggest that you use disk utility to verify that your startup disk is OK. 
    Macintosh-HD -> Applications -> Utilities -> Disk Utility 
    Start up disk utility.  On the left pane view, you will see a list of all your disks.  
    Click on your startup disk.
    Click on the First Aid  Tab.
    Click on verify.  
    Hopefully your disk will verify.  If not, you have to boot from your installation DVD and run Disk Utility from there to attempt to repair your file-system.

  • FTP file adapter: file access permissions do not allow the specified action

    Hi,
    I have the File to JDBC scenario. The file is extracted in AL11 folder of the Sending (BW) system.
    The folder is FTP enabled and the Unix admin says he has given full authorization to both the folder and ftp user.
    But in the File CC I get the following error "Could not process due to error: com.sap.aii.adapter.file.ftp.FTPEx: 550 TSMSACAIX5350.tar.gz: The file access permissions do not allow the specified action."
    Can some one advice what is wrong. Im pretty much sure it has to be a problem with the UNIX permission. But the unix admin person says he has given a full permission.
    I need to know what permissions needs to be given??  Is there different permissions for application level and OS level??
    Pls advice
    Thanks
    Prasanna

    >
    Prasanna Shanmugasundaram wrote:
    > Hi,
    > I have the File to JDBC scenario. The file is extracted in AL11 folder of the Sending (BW) system.
    > The folder is FTP enabled and the Unix admin says he has given full authorization to both the folder and ftp user.
    > But in the File CC I get the following error "Could not process due to error: com.sap.aii.adapter.file.ftp.FTPEx: 550 TSMSACAIX5350.tar.gz: The file access permissions do not allow the specified action."
    >
    > Can some one advice what is wrong. Im pretty much sure it has to be a problem with the UNIX permission. But the unix admin person says he has given a full permission.
    > I need to know what permissions needs to be given??  Is there different permissions for application level and OS level??
    >
    > Pls advice
    >
    > Thanks
    > Prasanna
    In CC you set ON the delete mode, after processing file? Maybe, the file have read only permission....

  • Image file access dates changing in mass (Windows).

    In review of the access date properties for image files within a directory being accessed by Bridge within the Favorites area, they are all changing to the current time and date, even if the image is not viewed within Bridge.  Why are the access dates of image files being changed even though they are not viewed?  This makes it hard to determine whether an image can be archived or deleted based on last access if Bridge is always changing the access date every day.  Thanks for any insight you can give on this!

    Is there a way to turn off the caching of thumbs or metadata or whatever is causing the Access date to change when searching or reviewing images within a directory using Bridge?
    As said, no experience with network environment. But Bridge is a browser and when you want to view things it needs to cache the file and data first.
    Having said that, in normal usage (stand alone) it stores and saves this data in the cache folder and once it has done so it will not need to recache until you have made changes to the file. Check Bridge prefs / Cache/ Location  to see where the data is stored when you are using this machine.
    By default on a stand alone Mac (windows seems to have a similar cache file) it should be in the User Library/ caches/ Adobe/ Bridge CSxx and inhere is a plug in and a folder called Cache, containing several folders.
    For Bridge CC there are 4 folders, 256 (the cache files of the thumbs) 1024 (containing HQ preview cache files) data (what it says) and full (containing the 100% previews in cache)
    All files that have been fully cached (pointing to a folder the content window should show already good thumbs and the activity bar bottom left in Bridge window should not show any activity, only the number of items showing and items hidden) don't need to recache for that machine again unless you changed something to the file or added metadata.
    So once cached there should be no reason for Bridge to 'access' the file again unless access means looking for the file to check if the saved data still applies to the corresponding file on your machine, but then al files should show about the same access time because this is a very fast process on a fast machine.
    You can't deselect cache because as said Bridge is a browser showing the content of your files, and to show this it has to generate a thumb and if needed a preview. But as also said, once cached it normally should not start recaching until changes are applied.
    You have several ways to set the quality of the cache:
    There are two checker board icons top right that give you the option to set for cache. By default it is set to 'Always HQ' to have both good thumbs and a good preview when pointing to a file.
    Then you also have to option to generate 100 % previews which provides you with almost instant 100 % previews for loupe in preview panel or full screen view and click. Logically this needs more time and generates a lot of big cache files, all depending on the files you start with and the size of your monitor.
    Finally you have the option to use embedded previews only. This is a very quick method but provides low quality thumbs (black border around it) and when clicking on a thumb it first needs to generate a HQ preview that then will take time.
    In Bridge prefs advanced there is the option to create also monitor sized previews which should provide you with good quality full screen when using space bar in Bridge to preview in full screen.
    This setting also creates a bit larger cache files in the 1024 folder depending on the size of your monitor (logical).
    And if you want to apply a search using the find command you also have to include non indexed files to search in all folders, including the not before cached files.
    Like first time cache this first indexing takes some extra time but should only need to be done once and then be persistent until you add new files or folders that have not been cached or indexed before.
    Until so far the theory for a stand alone. If you have the files stored in a Network and other stations have access and have different cache settings or monitor size settings there might be some other things going on, or someone else has changed the file on their station and then when you select that folder Bridge needs to recache the changes.
    Hopefully this makes some sense for you?

  • Hello,i have changed the access of library and system files in macintosh HD through get info option.i changed the access to write only access for library and system files to no access for everyone.then mac stopped working..nothing opening now.

    hello
    i have changed the access of library to WRITE ONLY and also i changed the access of system files to NO ACCESS FOR ANYONE in macintosh HD.then,suddenly it stopped working.i tried it shut down.then it didnot shut down.then i pressed ctrl+command+power button.then it was shut down.
    NOW, nothing is opening in macbook pro.it is opening and only apple logo is shown.what should i do now.i knew nothing in mac.please help me.operating system is 10.7

    hello CT,
    it showed
    permissions differ on library: should be drwxr-xr-r
    repaired "library"
    permissions differ on system: sholud be should be drwxr-xr-r;they are d-wx-----------
    repaired "systems"
    like this many steps occured.
    then next step is permissions repair complete.

  • NW6.5 FTP-file-mismatch with FTP over TotalCommander

    Hello *
    We use the FTP-Service within the TotalCommander-Program (TC from
    www.ghisler.com) to access a NetWare-NSS-Volume.
    Some filenames contains periods and space characters also
    (e.g. "1.2 Chapter x.pdf".)
    After a couple of weeks (~80 days) the displayed file-name changes: This
    happens within the TC-FTP-access only. All other access-methods (MS-FTP;
    Novell-NetStorage; NCP - Windows-Explorer) are showing the name correctly.
    e.g.
    access over NCP, MS-FTP, NetStorage | access over FTP within TC
    displayed filename |(after ~80 days) displayed filename
    ------------------------------------|----------------------------
    "2.1 Chapter ONE.pdf" |"Chapter ONE.pdf"
    This happens from every PC at the same time, so there have to be some
    changement on the NetWare-Server.
    Volume compression is disabled (nssmu.nlm)
    We have to copy or open and save the file again to get rid of this for
    the next ~80 days ...
    Any idea?
    oskar

    Thank you - Andrew,
    yes, SOPHOS-Anti-Virus is installed, and there is a regularly Backup-Job
    also. But both are running weekly ...
    Anyway, we have to move the data to a new OS ... (could be a solution
    for this ...)
    By the way, Symantec-Backup-Exec-Support told me, that restoring the
    trustee-rights (from a NetWare-NSS-Volume-Backup) to a OES-NSS-Volume is
    not supported ("reason: ... it is another OS!").
    Can you recommend a smooth method to move the data from NW to OES?
    Kind regards
    Oskar
    Am 01.02.2012 22:56, schrieb ataubman:
    >
    > OK, well that's fine. I have no idea what your problem is, there is no
    > automatic process on NW that runs every 80 days. The closest I can think
    > of would be the NSS background check; Normally it runs 5 days after the
    > server comes up and every two weeks thereafter.
    >
    > Do you have perhaps an anti-virus or backup that runs a scan regularly
    > over the volumes at that interval?
    >
    > That aside all I can suggest is a rebuild:
    >
    > nss /poolrebuild /purge
    >
    >

  • PSD files sent over FTP given 1kb file size, archived, and have .bin appended to extension

    I'm trying to deliver PSD files to someone over our server's FTP. If the FTP shared folder is accessed via a browser (like safari which is the main thing I've been testing on), the files in are listed as being only 1kb in size when each is approximately 60MB and all have had .bin appended to the .psd file extension. When the file is downloaded it's still 1kb and when opened it is associated with the archive utility which attempts to unarchive it and produces and identically named and extensioned file of 4kb size which cannot be opened by preview or text edit or photoshop.
    Changing the extension does not help as suggested here http://forums.appleinsider.com/archive/index.php/t-25119.html . Also if the file is downloaded via 3rd party FTP software like cyber duck, though the file size is listed as 1kb, the correct size file is downloaded though still has the .bin extension. When this full sized .bin file is opened, archive utility instead of unarchiving attempts to archive it and produces a file roughly half the size which too cannot be opened. Speaking with apple care resulted in the suggestion that I use terminal command line to force the client to use binary mode when downloading the file which also downloads a file of correct size but with the .bin extension and that can not be opened.
    Is this a known issue with PSD files? I've not come accross this before, the server is configured correctly and different file types are successfully downloading with no changes to size or extension and then opening as they should upon receipt at the client side.

    Hi and thanks,
    that was my next port of call but I stumbled across a more permanent fix. Mac OSX server automatically converts files sent over FTP to something called MacBinary on the fly and it seems this process doesn't agree with PSD files. Someone else encountered this problem back in 2003 and found this solution
    http://forums.appleinsider.com/archive/index.php/t-25119.html
    speaking to apple care they also sent a link for the official mac instructions for achieving the same thing here
    http://support.apple.com/kb/TA20996
    and here
    http://support.apple.com/kb/TA20645?viewlocale=en_US
    in the second explanation it's important to note for anyone attempting to follow this that if you're fixing the problem on MacOsX server rather than just MacOSX it isn't necessary to enable the root account as it is automatically enabled by default. Simply log out and log back in as root and use the same password as the first administrator account you set up when the server was first configured.

Maybe you are looking for