Is there a way to pull  User, Group , Other permissions of a file

I wanted to know whether Java provides any API to pull up each and every permission associated with a file.
For example: In Unix, a file has 3 sets of permissions as shown below:
<UserPermissions><GroupPermissions><Others'Permissions>
Example: -rwxrwxrwx
r - for read
w - for write
x - for execute
There are some methods provided in java.io.File, such as canRead() and canWrite(), which help in telling whether a file is readable or writable. But I did not find any API which tells whether a perticular user has read/write/execute permission or not. Also, I presume the canRead(),canWrite() methods pull up the permissions pertaining to the owner of the file, but not for the group and others part of a Unix File's permissions.
Is there a way to pull up the read/write/executable permissions for all the 3 catergories namely, UserPermissions, GroupPermissions and Others'Permissions.
I appreciate your note on this and appreciate your time too.

In the java.io.File class, there's methods canRead() and canWrite().
They will test the read/write permissions of the Unix user you are running your Java program with.
They will not return a list of user names, user groups etc though.
You'd have to get the permissions through some platform specific method, eg. via JNI.
regards,
Owen

Similar Messages

  • Is there a way to disable user groups?

    Just curious if there is a way to disable user groups in Essbase rather than the indevidual users?Thanks!

    I do not think there is a way to disbale the group - like a check box function (but that would be a ncie feature)- but you can consider the group "disabled" if you change the App/Db access of that group to nothing - you would just have to change the highest level of what you have defined for the group - so for instance change all of the APPS from "Access Database" to "None"...

  • Is there a way to create user logins or some other way to ...

    Is there a way to create user logins or some other grouping for a set of applications to use (memory) resources optimally -- for example only mail and Safari and Word in one grouping and another for Safari and an audio recording application, etc.?

    It is possible to use Parenal Controls to limit which applications can be used be a particular user account.
    But it's not really necessary as far as managing memory.
    Matt

  • Is there any way to pull in movies from an external HD if my internal is full

    Is there any way to pull in movies from an external HD if my internal is full?

    I can make PHONE CALLS from my iPhone 6 on my MacBook???
    (And then, I assume, my iPad?)

  • Is there any way to report users for spamming?

    Is there a way to report users for spamming?
    One of them in this forum is now editing their handle to nearly match genuine users.

    Use the [url http://forums.oracle.com/forums/forum.jspa?forumID=29]Community Feedback and Suggestions Forum to report spam and for question about the Forum performance login performance etc... but not for product related questions.
    Tony

  • I use a Pandigital Photlink one touch scanner. In order to get iphoto ro recognize the jpegs after loading them from an hd card onto the computer i have to 'save as' each one into documents and them 'open with' iphoto.  Is there a way to do a group 'save

    I use a Pandigital Photolink one touch scanner.  Then I upload the pics from the hd card to the computer.  In order to get iphoto to recognize the images I have to first save each photo using 'save as' to my documents, then 'open with' iphoto.  Is there a way to do a group 'save as' and then open the group in iphoto?
    Scanning this way is much faster than using my printer but having to save each individually defeats the purpose.
    Thanks,  Gailfromlangley

    I use a Pandigital Photolink one touch scanner.  Then I upload the pics from the hd card to the computer.  In order to get iphoto to recognize the images I have to first save each photo using 'save as' to my documents, then 'open with' iphoto.  Is there a way to do a group 'save as' and then open the group in iphoto?
    Scanning this way is much faster than using my printer but having to save each individually defeats the purpose.
    Thanks,  Gailfromlangley

  • Is there a way to move a group of tabs to a new window? I know how to move one tab to a new window, but is there a way to mark a group of tabs and move them to a new window?

    Is there a way to move a group of tabs to a new window? I know how to move one tab to a new window, but is there a way to mark a group of tabs and move them to a new window?

    * Tab Mix Plus: https://addons.mozilla.org/firefox/addon/tab-mix-plus/

  • I cant access any of the content that was in my music library that was set up on my old destroyed laptop. so Home Share cant be used.  Is there a way to pull all of the music content, not just iTune purchased music from my 4th Gen Nano back into iTuunes?

    I cant access any of the content that was in my music library that was set up on my old destroyed laptop. so Home Share cant be used.  Is there a way to pull all of the music content, not just iTune purchased music, from my 4th Gen Nano back into my new iTunes set up on my new home compter?

    It has always been very basic to always maintain a backup copy of your computer.
    Use your backup copy to put everything back.
    The music sync is one - way - computer to ipod.  The only exception is itunes purchases.

  • Is there a way to export a group of contacts from "Contacts" to an CSV or Excel file?

    Is there a way to export a group of contacts from "Contacts" to an Excel or CSV file?

    Christine fm STL wrote:
    Is there a way to export a group of contacts from "Contacts" to an Excel or CSV file?
    I urge you to look at AB2CSV
    Easily choose a group, all groups or all cards to export.
    Complete control over what is exported and what is the delimiter.
    And it's free.

  • Is there any way to forse user to put at least 5 characters when using LOV?

    Hi gurus,
    I have a question.
    Is there any way to force user to put at least 5 characters when using LOV?
    I want user to put at least 4 characters before/when using LOV.
    Is there any way to do that?
    Thank you for your answers.
    Nerijus

    Hello,
    i've tested it both on 6i and 10g and also set the lov name at runtime.
    All i can say is, it does what it is supposed to do.
    So you should give it one more try:
    - leave the item properties NULL ( LOV name ) and NO ( Validate_From_List )
    - add following code in the WVI - Trigger
    IF :AUFTRAG_NEU.PN IS NOT NULL AND LENGTH ( :AUFTRAG_NEU.PN ) < 5 THEN
      Show_Message ( 'Bitte 5 Zeichen eingeben' );
      RAISE FORM_TRIGGER_FAILURE;
    ELSIF :AUFTRAG_NEU.PN IS NULL THEN
      NULL;
    ELSE
      SET_ITEM_PROPERTY ( 'AUFTRAG_NEU.PN', LOV_NAME, 'LOV_PN_PROJEKT' );
      SET_ITEM_PROPERTY ( 'AUFTRAG_NEU.PN', VALIDATE_FROM_LIST, PROPERTY_TRUE );
      IF SHOW_LOV THEN
        NULL;
      END IF;
      SET_ITEM_PROPERTY ( 'AUFTRAG_NEU.PN', VALIDATE_FROM_LIST, PROPERTY_FALSE );
      SET_ITEM_PROPERTY ( 'AUFTRAG_NEU.PN', LOV_NAME, '' );By the way, what exactly doesn't work?
    Bernd

  • Is there a way to hibernate tab groups so that they do not use RAM memory?

    Is there a way to hibernate tab groups so that they do not use RAM memory? I have a lot of tabs open and have organized them into tabgroups but my computer still uses a lot of the RAM on mozilla. Can I hibernate some of the tabgroups in any way?

    There was a bug filed in 2010, but it seems like it's halted.
    *https://bugzilla.mozilla.org/show_bug.cgi?id=591775 <sub>Please don't comment on bug reports. See [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla etiquette]
    I found an extension that might do this, but it's incompatible for me (Nightly in Linux)
    *https://addons.mozilla.org/en-US/firefox/addon/bartab/

  • Is there a way to view the messages I sent along with files in Adobe Send?

    Is there a way to view the messages I sent along with files in Adobe Send?

    Too bad...I wish that feature was still there that was in SendNow...I also have to go and get the recipients email each time I send a file instead of Send remembering the email addresses I have sent to in the past.
    Are any of the great features of SendNow going to be brought over into Send? Or are they just gone...I am a paying CC user...just curious what's going on at Adobe...Thanks for your very quick response though...I guess my message content is gone.

  • How to allow only the specified users/groups to open my pdf files...

    Hi there,
    I'm looking for resources/documents describing how to allow only the specified users/groups to open my pdf files by the Java API...
    I've found a sample code creating a policy in the following document.
    http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/wwhelp/wwhimpl/js/html/w whelp.htm?context=sdkHelp&topic=learn_lc_sdk_invokeremoting
    ( API Quick Starts (Code Examples) > Rights Management Service API Quick Starts > Quick Start: Creating a new policy using the Java API )
    But the sample code doesn't set recepients( users/groups ) who can open the pdf file.
    How can I make it ?
    Any samples ? or Does anybody can tell me which Java classes/methods I should use ??
    Policy#addPolicyEntry(PolicyEntry policyEntry) ??
    PolicyEntry#setPrincipal(Principal principal) ??
    or none of them ?
    Any hints are appreciated !
    Thanks.

    I'm not exactly sure what you are tying to do here, but typical approach when issuing one PDF par user/groups scenario goes like:
    1. Create policy for specific purpose and add principal (user/group)
    2. Apply policy on server side
    3. Deliver the file (via email etc...)
    If you are looking for sample codes, try quick start.
    http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/js/html/w whelp.htm?&accessible=true
    If you go "API Quick Start/Rights Management Service API Quick Starts", you might find something useful. I think you need "Creating Policies" or "Modifying Policies" for step 1 above, and "Applying Policies to PDF Documents" for step 2.
    Hope this helps.

  • Is there a way to access object from other schema?

    1. Is there a way to access object from other schema
    Without using synonym/public synonym without prefixing schema owner?
    2. If you do not see any object in all_objects by same name owned by connected user or public, can there still be objects hidden from this view? for instance synonyms created by SYSTEM
    TIA for help

    Well, you missed something somewhere. If there is no
    ALTER SESSION SET CURRENT_SCHEMA=whoeverthen there must be either public synonym for the object as this shows:
    SQL> CREATE USER a identified by a;
    User created.
    SQL> GRANT CREATE SESSION to a;
    Grant succeeded.
    SQL> CREATE USER b identified by b;
    User created.
    SQL> GRANT CREATE SESSION, CREATE PROCEDURE, CREATE PUBLIC SYNONYM to b;
    Grant succeeded.
    SQL> connect b/b
    Connected.
    SQL> CREATE PACKAGE test AS
      2     PROCEDURE testit;
      3  END;
      4  /
    Package created.
    SQL> CREATE PACKAGE BODY test AS
      2  PROCEDURE testit IS
      3  BEGIN
      4     NULL;
      5  END;
      6  END;
      7  /
    Package body created.
    SQL> connect a/a
    Connected.
    SQL> desc b.test
    ERROR:
    ORA-04043: object b.test does not exist
    SQL> connect b/b
    Connected.
    SQL> GRANT EXECUTE ON test TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc b.test;
    PROCEDURE TESTIT
    SQL> desc test;
    ERROR:
    ORA-04043: object test does not exist
    SQL> connect b/b
    Connected.
    SQL> CREATE PUBLIC SYNONYM test FOR TEST;
    Synonym created.
    SQL> connect a/a
    Connected.
    SQL> desc test
    PROCEDURE TESTITAnother possibility without public synonyms is that crv had granted the other user privileges on some object, and the other user creates a private synonym for that. When crv granted privileges on a different object with the same name, the private synonym became valid again. Something like:
    SQL> connect /
    Connected.
    SQL> drop public synonym test;
    Synonym dropped.
    SQL> GRANT CREATE SYNONYM TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    ERROR:
    ORA-04043: object test does not exist
    SQL> desc b.test
    PROCEDURE TESTIT
    SQL> CREATE SYNONYM test FOR b.test;
    Synonym created.
    SQL> desc test;
    PROCEDURE TESTIT
    SQL> connect b/b
    Connected.
    SQL> REVOKE EXECUTE ON test FROM a;
    Revoke succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    ERROR:
    ORA-04043: object "B"."TEST" does not exist
    SQL> desc b.test
    ERROR:
    ORA-04043: object b.test does not exist
    SQL> connect b/b
    Connected.
    SQL> DROP PACKAGE test;
    Package dropped.
    SQL> CREATE FUNCTION test (p_num IN NUMBER) RETURN NUMBER AS
      2  BEGIN
      3     RETURN p_num * 10;
      4  END;
      5  /
    Function created.
    SQL> GRANT EXECUTE ON test TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    FUNCTION test RETURNS NUMBER
    Argument Name                  Type                    In/Out Default?
    P_NUM                          NUMBER                  INSo, I would go looking for the synonyms.
    TTFN
    John

  • The latest version of Pages does not allow a Pages document to become a 'stationery pad'!  Is there a way to do this this other than through the 'Get Info' window?

    The latest version of Mavericks does not allow a Pages document to become a 'stationery pad'!  Is there a way to do this this other than through the 'Get Info' window?  As Pages templates cannot be ordered in folders, my many templates are effectively unusable now and I need to find another way to order and access them.

    Are you aware of that you can still use Pages 09 on Mavericks? You don't have to go thru the grieves of using the crippled Pages 5. Pages 09 should bi in Applications/iWork 09 folder.

Maybe you are looking for

  • IPhone-4 Voice Control not working properly

    I'm facing trouble with the iphone-4 voice control. Its not correctly recognizing my voice commands. When I ask it to call a specific phone number it never dials the correct number, I have notice that it happens for some specific numbers when asked t

  • Problem using jstl and displaytags

    Hi all, I am using display tags taglib for generation of table. One of the columns has to be shown with the hyperlink attached to it. In order to acheive this i am using jstl taglib together with displaytags <display:table name="reportList" id="row"

  • How to demand forecast for an item in APS

    hi how to create demand forecast for an inventory item in Oracle Demand Planning.ie, how to integrate inventory with APS. which document i have to follow regards Ganga Message was edited by: Ganga

  • Oracle Database 9.2.0.1.0 and Mandrake 8.2

    Hello Like other people, i have a probleme during Oracle instalation. "Error invoking target ntcontab of makefile /opt/oracle/product/9.2.0.1.0/network/lib/ins_net_client" Some people propose too modify $ORACLE_HOME/bin/genclntsh, but the variable do

  • Where to log after calling BSSV from within C BSFN?

    I called a BSSV object from within a C BSFN. This BSSV object will return E1MessageList. I want to know where can I log these E1 Messages from within the C BSFN? Any documentation about this is greatly appreciated. I'm using E900 and JDeveloper 11g.