File system permission check

Hi,
I'm trying to check whether an user has permission to explore a folder in the filesystem. I've reached to capture a NullPointerException when i use the list() mehod for the file object, but I wanted to check it before the exception has to be thrown.
When I search in the forum I find many information about checking if the code has permission, but I want to check the user, not the code.
Does anyone know how to do it?
(If someone found the information in the forum, please post a reference)
Thank you

I forgot that I've used canRead() before :-S
And, of course, it doesn't work.
Maybe some piece of code can help (I've tried to rewrite it in English, sorry for the translation problems ):
File f = new File(rutaBase);
            String[] rutasPosibles = null;
            int longTotal = 0;
            int longRoots;
            int longListado = 0;
            int k;
            if (!f.exists()) {
                Trazas.escribir("can't open dir: " + rutaBase);
            } else {
                Trazas.escribir("processing " + f.toString());
                Trazas.escribir("permissions on="+f.toString()+" canRead()="+f.canRead()+" canWrite()="+f.canWrite());
                    FilePermission perm = new FilePermission(rutaBase, "write");
                    boolean correct = false;
                    try {
                    AccessController.checkPermission(perm);
                    correct = true;
                    } catch (AccessControlException ace) {
                    Trazas.escribir("ACCESS CONTROL");
                    ace.printStackTrace();
                    correct = false;
                    } catch (Exception e) {
                    e.printStackTrace();
                    correct= false;
                    } finally{
                    Trazas.escribir("all correct: "+correct);
                longRoots = File.listRoots().length;
                try{
                longListado = f.list().length;
                }catch (SecurityException e){
                    Trazas.escribir("SECURITY!");
                    e.printStackTrace();
                }catch (NullPointerException e){
                    Trazas.escribir("NULL!");
                    e.printStackTrace();
                }catch (Exception e){
                    Trazas.escribir("OTRA");
                    e.printStackTrace();
                And the result is:
ListaDirectorioLocal$ListadoInternoLocal.generarListado(ListaDirectorioLocal.java:63).->processing S:\cuestionarios
ListaDirectorioLocal$ListadoInternoLocal.generarListado(ListaDirectorioLocal.java:64).->permissions on=S:\cuestionarios canRead()=true canWrite()=true
ListaDirectorioLocal$ListadoInternoLocal.generarListado(ListaDirectorioLocal.java:79).->all correct: true
ListaDirectorioLocal$ListadoInternoLocal.generarListado(ListaDirectorioLocal.java:92).->NULL!
java.lang.NullPointerExceptionSo I assume that neither canRead()/canWrite() from file nor checkPermission() from AccessController can be used to check if the user have permission to list the folder.
About IO and Applets, that's why I have my code signed. Once signed, I've had no problems in creating files and folders on my local-and-shared filesystem. I feel sorry for not being able to explain more clearly since the beginning. And maybe I must say my code is written using 1.4
I'm really grateful for your patience with me.

Similar Messages

  • "An error occurred creating the application.Check file system permission"

    Hi There ,
    I am facing a problem in creating a webcenter portal webapplication.
    I have followed the steps given in Help topics of Jdeveloper,but after performing all the steps i am getting this error
    "An error occurred creating the application.Check file system permission". Kindly help me to get through this error.
    Regards
    Vivek

    Hi Vivek,
    I hope this is the problem with permission.you Don't have Admin permission to access those folder.
    my Suggestion is
    1.use Administrator account(on windows) for develop applications(its give full access to the folder from your system). or
    2 open your JDeveloper as Administrator. (just right click on JDeveloper from you shortcuts or from programs run as Administrator)
    I hope this will be helpful.
    Best Regards
    Siva Sankar

  • HT203172 Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired. When I repaired "disk permission", this message was what came up. What does this mean, and how can

    Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent” has been modified and will not be repaired. When I repaired "disk permission", this message was what came up. What does this mean, and how can I fix it?
    The opperating system I am using is 10.7.4, and updating to the latest version currently. Computer is running fine, except that when I did some utility repairs, I got the warning above, and not really sure what do, in regards to repairing it correctly, not just getting the message off of my computer.
    Thank you for your help, and please only contribute if you know about this issue please.

    That's a status message which can be safely ignored.
    (70090)

  • BSD Root - File System Check

    My 2.8Ghz iMac has being running very slow recently.
    I performed a File System Check and noted that my hard drive had the following message against it.
    Major 14 Minor 2
    Does that mean it is about to fail?

    yes.
    Have backups for ALL your data.
    Take to nearest Apple Authorized Repair Center for new drive.

  • [SOLVED] Systemd stuck at "Starting File system check"

    Hi all
    Backstory
    My hardware:
    Mobo: Gigabyte X99 2011v3 with UEFI and dual bios.
    GFX: MSI GTX 970 4GB Gaming OC
    HDD: Samsung 850 Pro 1TB SSD
    CPU: intel 5820k
    I have been using arch for about 2 years now. I recently bought new hardware, Gigabyte X99 motherboard uefi dual bios. I have tried a couple of times to install arch the old way, i.e. legacy mode or normal bios mode, however after a successful install, when I reboot my bios says "Select Proper Boot Device". Then I decided to put everything in UEFI mode and install arch using the uefi install disc. At first, I was not very successful, because I followed the arch wiki to the bone but when it comes to UEFI, instructions are a bit vague. In any case, I managed to install Arch and get uefi to work 100% by using this guide http://jorisvandijk.com/2014/installing … pt-system/ .
    Problem
    After installing arch successfully using UEFI mode, arch starts booting up, everything shows [OK] at the side, no errors, however, it hangs after a line that reads "Starting File system check ". I am not at home right now, however I thought I could start troubleshooting and maybe get some ideas.
    I have tried the following.
    - Chrooted back into my arch install using the live cd and mounting my partitions.
    - Updated and synced pacman.
    - Removed all journal log files.
    - reinstalled Systemd.
    - rebuilt kernel modules.
    none of the above worked. It still hangs at "Starting fiel system check"
    Any ideas.
    SOLUTION
    Solved by using
    nolapic
    Still had other problems after that, however, the initial problem was solved.
    Last edited by janpansa (2015-02-26 20:04:24)

    jasonwryan wrote:Taking the time to read through the relevant pages and working through the Beginners' Guide methodically is the best (and only) way to both install Arch and also bed in a sound understanding of how your system is put together. It is an investment that will continue to pay you back as long as you run a Linux/UNIX box.
    Hi Jason,
    thx for your help so far. I have printed out the Arch beginners install and followed it to the bone and focusing on the UEFI parts. Arch installed without a single error, everything went smooth. Aftwerwards, I exited from the chroot environmount, unmount and reboot and again, it hangs on the startup. This time I took screenshots.
    I present to the board, exhibit A, arch starting up after a fresh install :
    http://oi61.tinypic.com/2m4x82o.jpg
    I now present to the board, exhibit B, arch starting up for a second time, after restarting the pc :
    http://oi59.tinypic.com/10ehvki.jpg
    Afterwards, I restarted again. Went into bios setup and checked my boot priorities. This is what I saw:
    I now present exhibit C, my bios boot options :
    http://oi62.tinypic.com/24ys0bd.jpg
    I tried all the options listed for my Samsung SSD, with and without UEFI as well as the option that was the default aka Linux boot manage". Each one did exactly the same.
    I have a few ideas :
    1.) Leave out swap.
    2.) Disable fscheck.
    3.) I have a feeling that my SSD is reading/writing too fast and that fscheck is having trouble ?
    I am now trying option 1. In other words, I am reinstalling arch, again, following the beginners guide to the bone and focusing specifically on the UEFI parts. This time, I am leaving out swap. (I have 16GB of DDR4 memory). I have about a 70% feeling that the outcome will be the same. However, I will be back after that to comment on the outcome. Please leave feedback and help me through this where you can ! Thanks
    Last edited by jasonwryan (2015-02-23 19:34:21)

  • File system check fails "FATAL"

    Dear all,
    after about three of years of running, one of my Xsan filesystems died. The fsm process stops running after about 2 minutes in running state. A filesystem check with cvfsck -w -v <Name> ends with:
    Creating Daten allocation check file.
    Stripe Group Daten ( 0) 0xe8def800 blocks.
    Building Inode Index Database 91458560 ( 52%).
    Fatal: rf_relblk write failed - Input/output error
    Building Inode Index Database 91459584 ( 52%).
    Fatal: Cannot insert inotab for [0x32a9e378800]! -No such file or directory
    Fatal: Cannot build inode tracking tree - Input/output error.
    I cannot see any misbehaviour of the hardware itself. RAID Admin is green everywhere.
    The filesystem size is about 17 TB and the data is quite important. Is there any way to proceed without re-formatting?
    Some more information I found in the log files:
    [0923 16:26:42] 0xa000ed88 (debug) FSS 'Experiments' REGISTERED -> DYING, next e
    vent in 60s
    [0923 16:26:43] 0x1802e00 INFO Disk rescan found 10 disks
    [0923 16:26:43] 0xa000ed88 INFO NSS: Active FSS 'Experiments[0]' at 192.168.100.
    10:49275 (pid 354) - dropped.
    [0923 16:26:45] 0x1801600 ERR Portmapper: FSS 'Experiments' (pid 354) exited on
    signal 4
    [0923 16:26:45] 0x1801600 ERR FSS 'Experiments' appears unstable (2 failures in
    60 minutes or less), halting restarts
    [0923 16:26:45] 0x1801600 (debug) FSS 'Experiments' DYING -> STOPPED (corefile l
    imit exceeded)
    Any hint is really appreciated.
    Best regards,
    Torsten

    Thanks for the hint. Well, the cvfsck -j command succeeded rather quickly. But the -w afterwards fails again:
    Super Block information.
    FS Created On : Wed Aug 31 13:24:34 2005
    Inode Version : '2.3'
    File System Status : Clean
    Allocated Inodes : 173699072
    Free Inodes : 37814385
    FL Blocks : 9309
    Next Inode Chunk : 0x2c05d400
    Windows Security Indx Inode : 0x4
    Windows Security Data Inode : 0x5
    Quota Database Inode : 0x6
    ID Database Inode : 0xb
    Client Write Opens Inode : 0x7
    Creating Daten allocation check file.
    Stripe Group Daten ( 0) 0xe8def800 blocks.
    Building Inode Index Database 91363328 ( 52%).
    Fatal: Cannot insert inotab for [0x8261a053f400]! -No such file or directory
    Fatal: Cannot build inode tracking tree - Input/output error.
    Is there anything else I can do?
    Thanks,
    Torsten

  • IX4-300d I/O error, check file system, now stuck at software restart

    Good morning!
    I have a brand new IX4-300d. Was uploading files with sftp yesterday, which kept giving me errors, so I enable support access and checked the logs while uploading. Got a lot of:
    end_request: I/O error, dev sde, sector 16384
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 01 00
    end_request: I/O error, dev sde, sector 0
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 3a 38 17 c0 00 00 01 00
    end_request: I/O error, dev sde, sector 7814036992
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 3a 38 17 d3 00 00 01 00
    end_request: I/O error, dev sde, sector 7814037144
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 01 00
    end_request: I/O error, dev sde, sector 0
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 00 00 00 01 00 00 01 00
    end_request: I/O error, dev sde, sector 8
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 00 00 00 00 00 00 01 00
    end_request: I/O error, dev sde, sector 0
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 3a 38 17 c0 00 00 01 00
    end_request: I/O error, dev sde, sector 7814036992
    sd 16:0:0:0: [sde] Unhandled error code
    sd 16:0:0:0: [sde]  Result: hostbyte=0x07 driverbyte=0x00
    sd 16:0:0:0: [sde] CDB: cdb[0]=0x28: 28 00 3a 38 17 d3 00 00 01 00
    end_request: I/O error, dev sde, sector 7814037144
    So I requested a offline file system check from diagnose page. That was as off now 23 hours ago, from what I can see, the fs check did not take long, but has been stuck at DEvice software restarting for at least 22 hourse. I use less then 200Gig on it, setup as raid 10.
    This device is not 1 month old. I had it freeze on my once already, not while restarting, just froze up. So that is the second time.
    Status in the web console said all is fine, I had to go in through ssh and look at the os logs to find out what is happening.
    What should I do?
    Solved!
    Go to Solution.

    Hello CollegeMathieu
    Please contact support using the below support links so we can have the issue properly diagnosed.  There is a good chance that the unit may have shipped with a defective drive (if it is a diskless model one of your hard disks may be defective).  This could be causing the strange firmware behavior. 
    A couple of things to try :
    -power down the unit and re-seat all disks then try booting again to see if there is any change.
    -If the above does not work, try swapping disk 1 with any of the other hard disks while powered off and then try booting again.
    LenovoEMC Contact Information is region specific. Please select the correct link then access the Contact Us at the top right:
    US and Canada: https://lenovo-na-en.custhelp.com/
    Latin America and Mexico: https://lenovo-la-es.custhelp.com/
    EU: https://lenovo-eu-en.custhelp.com/
    India/Asia Pacific: https://lenovo-ap-en.custhelp.com/
    http://support.lenovoemc.com/

  • [solved] scritpt to check the used space of different file systems

    how to write a scritpt to check the used space of different file systems and print if any file system above 50%
    I used this command to get the different filesystem and their used space
    df -h | grep -v Filesystem |tr -s " " | cut -d" " -f1,5
    Thanks in Advance

    Please try this command:
    df -Ph | tr -s " " | cut -d" " -f1,5 | sed -n "s/\([5-6][0-9]%\)\|\([0-9]\{3\}%\)/&/p"
    It works for me. Good luck
    Tiger Zhang
    .

  • UPON boot up my computor always goes into a "checking file system on C"

    UPON boot up my computor always goes into a "checking file system on C".  It seems have started since last "Tuesday since the large update.

    This is the second part of my message that should stop the checking file system.
    Click Start, click All Programs, and then click Accessories.
    Right-click Command prompt, and then click Run as administrator.
    At the window that opens  type the following commands, pressing "Enter" after each one, please, note the spaces.
    chkntfs /d 
    chkntfs /c C:
    chkntfs /x C:
    Reboot the computer, it should go directly into Windows without checking the system.
    Please confirm if it starts normally and I need to know if the drive is "Dirty" or not.
    Please mark my post as SOLVED if it has resolved your problem. It helps others with similar situations.

  • Java script in HTMLDB to check if file exists in Unix file system

    How do I use javascript to check if file is exists in Unix file system. I would like to dispaly the columns only if file is exists.

    Hello,
    This is one of those features that the manuals do not cover.
    How to use and build AJAX features could be a whole book all by itself, and it's not really HTML DB specific feature even though we have built some hooks in application and javascript to make it easier.
    Take a look at this thread
    Netflix: Nice UI ideas
    and I've built some examples here
    http://htmldb.oracle.com/pls/otn/f?p=11933:11
    Or just search the forums for AJAX or XMLHTTP
    Carl

  • Nable to change permission of file system node / WAS 6.2

    During WAS 6.2 Installation (Step: Create SAP Program Icons - post processing) I receive the following message:
    FSL-02007  Unable to set access rights of E:/usr. SetNamedSecurityInfo: Diese Sicherheitskennung kann nicht als Besitzer des Objekts zugeordnet werden.
    ERROR 2004-10-21 13:25:20
    MOS-01085  Unable to change permission of file system node E:\usr\sap/.. with type DIRECTORY to (dg\SAP_LocalAdmin,GROUP,=rwx) (SYSTEM,GROUP,=rwx) (Administrators,GROUP,=orwx).
    ERROR 2004-10-21 13:25:20
    MOS-01105  Processing of one or more file system node operations of table   Content of table: t_SAPComponent_Permission_Action_SHARED  Row[0]    WapsSystemName="S01" WapsInstanceName="DVEBMGS10" WapsInstanceHost="dg" Key="WAPS_FilePermission_100" Condition="true" OpMode="SETPERMISSION" NodeName="E:\usr\sap/.." NodeType="DIRECTORY" NodePermission="(dg\SAP_LocalAdmin,GROUP,=rwx) (SYSTEM,GROUP,=rwx) (Administrators,GROUP,=orwx)" Recursive="YES"   Row[1]    WapsSystemName="S01" WapsInstanceName="DVEBMGS10" WapsInstanceHost="dg" Key="WAPS_FilePermission_101" Condition="true" OpMode="SETPERMISSION" NodeName="E:\usr\sap" NodeType="DIRECTORY" NodePermission="(dg\SAP_LocalAdmin,GROUP,=rwx) (SYSTEM,GROUP,=rwx) (Administrators,GROUP,=orwx)" Recursive="YES"   Row[2]    WapsSystemName="S01" WapsInstanceName="DVEBMGS10" WapsInstanceHost="dg" Key="WAPS_FilePermission_102" Condition="true" OpMode="SETPERMISSION" NodeName="E:\usr\sap/S01" NodeType="NODE" NodePermission="(dg\SAP_S01_LocalAdmin,GROUP,=rwx) (SYSTEM,GROUP,=rwx) (Administrators,GROUP,=orwx)" Recursive="YES"  failed.
    ERROR 2004-10-21 13:25:20
    FJS-00012  Error when executing script.
    Environment:
    W2K, Local Installation
    Dieter

    Das Dateisystem muß auf NTFS konvertiert werden. Dann klappts.

  • File system checking exit code 8

    Hi guys ... after done a filesystem checking I've got:
    +0100: Incorrect number of file hard links
    +0100: Checking catalog hierarchy.
    +0100: Checking extended attributes file.
    +0100: Checking volume bitmap.
    +0100: Checking volume information.
    +0100: The volume Macintosh HD was found corrupt and needs to be repaired.
    +0100: File system check exit code is 8.
    +0100: Error: This disk needs to be repaired using the Recovery HD. Restart your computer, holding down the Command key and the R key until you see the Apple logo. When the OS X Utilities window appears, choose Disk Utility.
    After restart the machine as suggested, my filesystem check exit without finding any problem, so ... what is the problem in fact? ...
    By the way: I do not have any strange behaviour on my mac, I normally run filesystem and permissions repairs in order to keep "him" clean and healthy. 
    Thanks in advanced,
    Jorge

    This seems to be a bug. You may be able to work around it by starting up from another physical device. Make sure you have a current backup before doing anything.
    If you have a "clone" backup on another drive—not a partition on the same drive—start up from it by holding down the option key at the startup chime and selecting its icon in the Startup Manager display. Launch Disk Utility and repair your primary startup volume—not the one you started from.
    If you have a Time Machine backup on a locally-attached storage device—not a network device such as a Time Capsule—there should already be a Recovery system on that device. Start up from it and repair in the same way as above.
    Otherwise, use Recovery Disk Assistant to create a Recovery system on a spare storage device, such as a USB flash drive, and start up from that device. All existing data on the Recovery device will be permanently erased.

  • Zfs destroy DOES NOT CHECK NFS mount file-systems

    I asked this question twitter once and the answer was a good one, but I did some checking today and was surprised!!
    # zfs destroy mypool/home/andrew
    The above command will destroy this file-system no questioned asked but if the file-system is mounted you will get back the Device busy and if you have snapshot then they will be protected as well
    server# zfs destroy mypool/home/andrew
    cannot unmount 'tank/home/andrew
    server# zfs destroy dpool/staff/margaret
    cannot destroy 'dpool/staff/margaret': filesystem has children
    use '-r' to destroy the following datasets:
    dpool/staff/margaret@Wed18
    dpool/staff/margaret@Wed22
    BUT?
    server# zfs destroy dpool/staff/margaret@Wed18
    server# zfs destroy dpool/staff/margaret@Wed22
    NFSclient# cd /home/margaret
    NFSlient# ls -l
    drwx------+ 2 margaret staff 2 Aug 29 17:06 Mail
    lrwxrwxrwx 1 margaret staff 4 Aug 29 17:06 mail -> Mail
    drwx--x--x+ 2 margaret staff 2 Aug 29 17:06 public_www
    server# zfs destroy dpool/staff/margaret
    server#
    GONE!!!
    I will file a bug report to see what Oracle say!
    Comments?
    I think there should be a hold/protect of file-systems
    # zfs hold dpool/staff/margaret
    Andrew

    The CR is already filed:
    6947584 zfs destroy should be recoverable or prevented
    The zfs.1m man page, which covers the mounted case and the ZFS admin guide are pretty clear
    about the current zfs destroy behavior.
    http://docs.oracle.com/cd/E23824_01/html/821-1448/gamnq.html#gammq
    Caution - No confirmation prompt appears with the destroy subcommand. Use it with extreme caution.
    zfs destroy [-rRf] filesystem|volume
    Destroys the given dataset. By default, the command
    unshares any file systems that are currently shared,
    unmounts any file systems that are currently mounted,
    and refuses to destroy a dataset that has active depen-
    dents (children or clones).
    I'm sorry that you were surprised.
    Accidents happen too, like destroying the wrong file system, so always have good backups.
    Thanks, Cindy

  • How to check if a file system in global zone is shared on zones

    Hello,
    Would you by any chance know how to detect if a file system in the global zone is shared with any zones created from the global zone (either shared with readonly or read-write)?
    Thanks in advance.
    Regards
    Frank

    Usually they're shared via lofs. So try 'df -kZ -F lofs'.
    Darren

  • While verifying permission using the disk utility program, I get the message: Warning SUID file "system/library/core has been modified and will not be repaired. What is this and should I take corrective actions?

    While verifying and repairing permissions using the disk utiliaty program, I get the message: Warning the SUID file "system/library/core has been modified and will not be repaired. What is this and do I need to take some corrective actions? Thanks. WDG

    Ignore it, your fine.
    http://support.apple.com/kb/TS1448?locale=da_DK
    If your tuning up your Mac, you need to read all the tricks.
    Step by Step to fix your Mac

Maybe you are looking for