Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How to lock a folder

How to lock a folder

Scheduled Pinned Locked Moved Java
javahelptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kurja kurdoh
    wrote on last edited by
    #1

    kindly help me how to lock a folder with java code

    L R 2 Replies Last reply
    0
    • K kurja kurdoh

      kindly help me how to lock a folder with java code

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      What do you mean by "lock"?

      The best things in life are not things.

      1 Reply Last reply
      0
      • K kurja kurdoh

        kindly help me how to lock a folder with java code

        R Offline
        R Offline
        RossouwDB
        wrote on last edited by
        #3

        If you mean to lock a folder in such a way that nobody can gain access to the folder, then you need to look at JNI, since folder locking is handled by the operating system, and not by java explicitly. Think of it as setting up access rights to a folder F1 for person A, but not person B. So is B now attempts to open F1, a nice message and loud boom will announce that access is denied. This is done by the operating system. Have a look at JNI: Java Native Interface[^] Java Native Interface Tips[^] Java Native Interface: Programmer's Guide and Specification[^] Otherwise, if you meant "how to lock a file during editing", have a look at this: How can I lock a file using java (if possible)[^]

        J 1 Reply Last reply
        0
        • R RossouwDB

          If you mean to lock a folder in such a way that nobody can gain access to the folder, then you need to look at JNI, since folder locking is handled by the operating system, and not by java explicitly. Think of it as setting up access rights to a folder F1 for person A, but not person B. So is B now attempts to open F1, a nice message and loud boom will announce that access is denied. This is done by the operating system. Have a look at JNI: Java Native Interface[^] Java Native Interface Tips[^] Java Native Interface: Programmer's Guide and Specification[^] Otherwise, if you meant "how to lock a file during editing", have a look at this: How can I lock a file using java (if possible)[^]

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          Probably be easier and faster to find an OS command and use Runtime.exec.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups