#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    2
    Rep Power
    0

    Access Windows files custom properties with Java ?


    Hello,

    I am trying to access Windows custom properties of a file (only available for some file types, like Office documents and some others), as shown below :


    I have managed to access the basic properties this way :
    Code:
    import java.nio.file.Paths;
    Path monFichier = Paths.get(WPath);
    BasicFileAttributes basicAttrs;
    basicAttrs = Files.readAttributes(monFichier, BasicFileAttributes.class);
    System.out.println("creationTime     = " + basicAttrs.creationTime());
    ...and that's OK.

    But I can't find a way (import, specific Java lib ?) to access these custom properties.

    Does anyone already had to play with them ?

    Thanks !
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,462
    Rep Power
    1874
    You need a Java wrapper to either OLE or DSO.

    Those extended properties are stored in the metadata of the files themselves, and are not part of the file system.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2017
    Posts
    2
    Rep Power
    0
    Originally Posted by salem
    You need a Java wrapper to either OLE or DSO.
    OK thanks. So let's have a look to JNA / JNI...

IMN logo majestic logo threadwatch logo seochat tools logo