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. File Explorer

File Explorer

Scheduled Pinned Locked Moved Java
question
6 Posts 3 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.
  • H Offline
    H Offline
    HTT90
    wrote on last edited by
    #1

    I'm doing about File Explorer which similar to Windows Explorer in Windows . I don't know why Windows Explorer get "Extract here , Extract File" ... which have when install Winrar . I want popup menu at forder to do it . Any idea ?? sorry about my english !! :( .

    T 1 Reply Last reply
    0
    • H HTT90

      I'm doing about File Explorer which similar to Windows Explorer in Windows . I don't know why Windows Explorer get "Extract here , Extract File" ... which have when install Winrar . I want popup menu at forder to do it . Any idea ?? sorry about my english !! :( .

      T Offline
      T Offline
      TorstenH
      wrote on last edited by
      #2

      write the functionality yourself. You don't need tools like winrar for this. this is how you can do it[^]

      regards Torsten I never finish anyth...

      D 1 Reply Last reply
      0
      • T TorstenH

        write the functionality yourself. You don't need tools like winrar for this. this is how you can do it[^]

        regards Torsten I never finish anyth...

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        I don't think that's what he's asking. I think his question is something like: I want to display a pop-up menu which will give the user a list of actions associated with a file type. For example, if the file is a RAR file, I want to display the options associated with Winrar. Think Windows Explorer, you right-click on a file and up pops a menu telling you what you can do with that file. I'm not sure how you do this from Java since finding the list of actions for a specific file type is OS-specific, and that is always where Java's "run anywhere" approach struggles. The Desktop API gives you some access to this, but it has a limited set of pre-defined actions available and I'm not sure how you add in other actions like zip or unzip (or even if you can). There was a project on the go at one time called JDIC which aimed to make OS-specific desktop integration a bit easier, but I haven't heard about that for a while. It was basically a series of wrappers around native calls for the main operating systems like Windows and Linux. It might be worth a look, though, if it is still around.

        T 1 Reply Last reply
        0
        • D David Skelly

          I don't think that's what he's asking. I think his question is something like: I want to display a pop-up menu which will give the user a list of actions associated with a file type. For example, if the file is a RAR file, I want to display the options associated with Winrar. Think Windows Explorer, you right-click on a file and up pops a menu telling you what you can do with that file. I'm not sure how you do this from Java since finding the list of actions for a specific file type is OS-specific, and that is always where Java's "run anywhere" approach struggles. The Desktop API gives you some access to this, but it has a limited set of pre-defined actions available and I'm not sure how you add in other actions like zip or unzip (or even if you can). There was a project on the go at one time called JDIC which aimed to make OS-specific desktop integration a bit easier, but I haven't heard about that for a while. It was basically a series of wrappers around native calls for the main operating systems like Windows and Linux. It might be worth a look, though, if it is still around.

          T Offline
          T Offline
          TorstenH
          wrote on last edited by
          #4

          Is this needed any more? compressed folder/files are nowadays opened by the file explorers. Other extensions should be thrown against the OS to open/execute it - you'll get the "don't know how" dialog if the file extension is not known.

          regards Torsten I never finish anyth...

          D 1 Reply Last reply
          0
          • T TorstenH

            Is this needed any more? compressed folder/files are nowadays opened by the file explorers. Other extensions should be thrown against the OS to open/execute it - you'll get the "don't know how" dialog if the file extension is not known.

            regards Torsten I never finish anyth...

            D Offline
            D Offline
            David Skelly
            wrote on last edited by
            #5

            I think the whole zip file, Winrar thing was just an example from the OP. If I read his post correctly, he's trying to build a Windows Explorer clone, that's his main interest here. The whole issue of how to compress or uncompress files is a bit of a red herring. It's more of a general question about file types and actions. The Java Desktop class allows you to Open, Print, Edit files with a bit more control than simply shelling out and trying to run the file. For example, you can test whether or not there is an Edit action associated with a file type as distinct from Open (think of *.cmd files on Windows: Open and Edit do different things). What it doesn't let you do is access non-standard options that other programs like Winrar may associate with specific file types like *.zip or *.rar, for example Extract Here as opposed to Extract. The NetBeans Platform includes an API that allows you to associate arbitrary actions with file types, but it is up to you (the programmer) to create the association, it is not derived from the underlying operating system.

            H 1 Reply Last reply
            0
            • D David Skelly

              I think the whole zip file, Winrar thing was just an example from the OP. If I read his post correctly, he's trying to build a Windows Explorer clone, that's his main interest here. The whole issue of how to compress or uncompress files is a bit of a red herring. It's more of a general question about file types and actions. The Java Desktop class allows you to Open, Print, Edit files with a bit more control than simply shelling out and trying to run the file. For example, you can test whether or not there is an Edit action associated with a file type as distinct from Open (think of *.cmd files on Windows: Open and Edit do different things). What it doesn't let you do is access non-standard options that other programs like Winrar may associate with specific file types like *.zip or *.rar, for example Extract Here as opposed to Extract. The NetBeans Platform includes an API that allows you to associate arbitrary actions with file types, but it is up to you (the programmer) to create the association, it is not derived from the underlying operating system.

              H Offline
              H Offline
              HTT90
              wrote on last edited by
              #6

              Thank you . Great answer . :) .

              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