How can I get the file type?

Hello

I try to get the type of a specified file. But I don't want to get the file extension.


Instead I used the UNIX file command:

file - mime-type myfile.myExtension

Then I execute this command in my java class using the exec() method. Everything works fine. The main problem is that I need the file command in my BONES. If I run my java code on a Windows machine, it does not work. So, I'm just wondering if anyone knows how to get the type of file in a different way?.

Kind regards
Hopcroft

A quick search on google (java file mime type) faces up to this:

http://www.rgagnon.com/javadetails/Java-0487.html

There is certainly no reliable way, but perhaps one that is listed on this page is "good enough."

Tags: Java

Similar Questions

  • How can I specify the file types to be included in a library in Windows 7?

    How can I specify the file types to be included in a library?  For some reason any overall my library it shows ALL files and not only the documents in the document library, the music in the music library and the pictures in the picture library.  In other words in my document library, it is also show all my music and my photos, in my music library, that is to show all my documents as well as all my photos etc.  I know I have to do something wrong but does not know what it is.  Can someone help me please?

    * original title - libraries and some type of file

    Hello

    Libraries should show only the files that are contained in the files that you add to this library.

    Example:

    In Windows Explorer, select the Document library.

    In the window display on the right, click the link x sites in the top/left of the window.

    This will open a dialog box displays all the folders that have been added to this library.

    By default, the Library of Documents should show the folders My Documents and public records .

    If there is other records showing that you don't want in this library, Select the folder and click on the Remove button.

    You can also right click the documentslibrary, in the Part of Navigation and select Properties. At the bottom of the Properties dialog box, click on the button by default is restore to remove all additional files have been added.

    Tell us what you find.

    Concerning

  • I have just reactivated Dreamweaver on a new computer.  How can I get the files FROM my website ON my computer so I can edit/update using Dreamweaver.

    I have just reactivated Dreamweaver on a new computer.  How can I get the files FROM my website ON my computer so I can edit/update using Dreamweaver?

    If your old machine still works, export your definition of original site to a portable player, copy in your new machine and then import the site definition to the new machine. The definition file will have the extension .ste

    Create an empty folder on your new machine.

    Define a 'new' web site on your new machine to point to the new local root folder.

    Log your server and download all of the subfolders and files in the folder root from the server to the new local root folder.

  • How can I get the files to display an icon, but as a thumbnail photos?

    I want my document to display as icons files, but makes all my photos are displayed also as a generic icon.  If I uncheck always show them icons, never thumbnails in the folder options and then my documents files show as thumbnails, and I don't want that.  Is it at all possible to display as icons of the folders of paper but photo folders to display thumbnails?  Up to two hours this is how my files appear (documents as icons, pictures as thumbnails).  All of a sudden, it's one or the other.  How can I get this back to the original way?

    It goes to its strange, but I solved the problem.  I ran a cycle of repair Microsoft Office 2007!  Now, my pictures are back to thumbnails, while my documents remain icons.  I feel a bit silly for you put through that much trouble.  So my apologies and thanks for trying to help me.

  • My computor would not start windows, so I got the opption to boot with the disc. But with the TI istalled a new windows 7 on my computor and all my files are gone. How can I get the file.

    second copy of windows 7 has been installed. How can I retrieve my files from the old copy of windows 7

    That depends on the options you chose when you made the installation.  If you chose to keep your old files, you can view the folder c:\windows.old .  If you opted to install on another partition, you can retrieve the files from the old partition.  Otherwise, you would have to have supported your computer before reinstalling.

    When you got your system back as you, I invite you to buy an external hard drive, and a good backup 3rd party program. You can configure it to automatically do everything in time and frequency of your choice. External hard drives 1 TB are about $85 these days and a very good FREE backup program corresponds to the Easeus todo backup free of charge that you can download from

    http://www.todo-backup.com/products/home/free-backup-software.htm . Who can make you save a lot of time and frustration, the next time something like this happens. Sooner or later, it happens to all computers for one reason or another.

    Good luck.

  • How can I get the file name of a report, I have just stored in the cache

    I would like to be able to get the file name of the report that is stored in the cache directory.

    When a report is created from forms to help

    SET_REPORT_OBJECT_PROPERTY (v_report_id, report_desname, 'fubar.pdf');

    In the cache directory a file is created something like fubarABC123DE.pdf. I guess that part of ABC123DE is the cache key.

    I want to be able to read this file from another process. This process cannot use http, so I can't pass the URL. However, I would still be able to access by using the URL.

    Is all the same to get at the file name?

    The answer is, according to management, you can get the name of the file in the cache, so if you want to access the file you need to store somewhere else.

  • How can I change the file type extension?

    Help please!

    I was working in Paint.net and thought that my changes have been saved but I incorrectly saved in Paint.net it as 'nom.1' and making it inaccessible to paint.net or any program being the type of file 'file '.  I then changed the name of "long.bmp", and who seemed like he did to be accessible but Paint.net is still not open it.  On another file that I made the same mistake on, I changed the name to "name2.pdn" that worked and I am able to open it properly.  I tried to change the name on the premiere of "name.pdn" in Windows Explorer, but for this file, it only changes the name "name.pdn" and not the extension.  It's always a ".bmp" file  How can I change to a file real '.pdn '?

    Thanks for the help

    Hello

    How to change a file Extension
    http://maximumpcguides.com/Windows-Vista/how-to-change-a-file-extension/

    The names of files and file name extensions: frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/file-names-and-file-name-extensions-frequently-asked-questions

    -----------------------------------------------------------------

    How to view and change an Extension of filename on Vistahttp://www.vistax64.com/tutorials/103171-file-name-extension.htmlhow Unassociate a file in Vista Type of Extension and a utility for you helphttp://www.vistax64.com/tutorials/91920-unassociate-file-extention-type.html
    How to set default Associations for a program under Vista
    http://www.Vistax64.com/tutorials/83196-default-programs-program-default-associations.html

    How to associate a file Extension with a program Type in Vistahttp://www.vistax64.com/tutorials/69758-default-programs.html

    Restore the Type Associations by default Vista file extensions
    http://www.Vistax64.com/tutorials/233243-default-file-type-associations-restore.html
    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • In a direct way: How can I get the files from Adobe Photoshop or Illustrator sketches?

    I type sent to the PS or Illustrator I get the message "Sent", but nothing happens in my CC account (in exodus the file I work in is not stored in memory) or in my Office Photoshop. What can go wrong?

    Here's what you need to make this feature work correctly:

    1. Make sure you have the latest version of the installed Creative Cloud Desktop application. You can get the latest software from here
    2. You must subscribe to the creative cloud, CC of Photoshop or Illustrator CC.
    3. You must be connected to your software CC (CC Desktop app, CC of Photoshop or Illustrator)

    If all goes well, which solves the problem. If not, send me another line.

    Thank you

    Will Eisley

    Product Manager

  • How can I get the file name of a link icon library?

    Hello

    With the help of AW 7.02

    I have a couple of files in the library, one contains graphics, the other audio. I use a diving routine to run through the icons in the file a7p and if it is a sound icon that is "tied", I want to make sure that it is related to the audio library file. What I am having a problem with is to get the name of the linked file.

    Is there an icon property that contains the info related? I believe that there is, as when I right click on a sound icon associated with a library file, I noticed that I could choose library links... in the drop-down menu, and I found the following data:

    Library link name: 1.3.1s
    Related to: 1.3.1s
    In Library:lessonAudio.a7l < < <-that's what I'm interested in getting (if it is lessonGraphics.a7l then I want to warn the developer)


    A little test I did with an audio icon in the flow line just before the content of calc below:

    T_Str: = GetIconContents (IconPrev (IconID)) - produces: [[#type: #linkedIcon, iconID:262168 #]]
    If T_Str [1, #type] = #linkedIcon then
    T_Str1: = GetIconContents(T_Str[1,#iconID]) - product: [[#type: #sound, #filename: "', #storage: # #format internal,: 'MP3'"]]
    on the other
    T_Str1: = ' otherwise, something else. "
    end if

    #filename above seems not to be the place to look because it can contain the path to the mp3 file, IF this info is still available.

    FYI, the audio in the library file is NOT related to the outside.


    Thank you

    Mike

    Mike,

    Thank you for your quick response. I used GetLibraryInfo() as you suggested.

    Mike

  • How can I get the file menu appears?

    I want to be able to have a file menu so that I can select the characters etc. directly from my main screen. One of the programs help says I have a upper left menu which is not displayed. I accidentally chose a program ASK that reset my features of Mozilla and I can't get back them. I deleted ASK, but it is always reset my appearance of Mozilla. I removed Mozilla and reinstalled nothing doesn't. I restored my computer to an earlier time.

    You see the tab bar and the main toolbar? Otherwise:

    • Firefox may be his view full screen. The F11 key toggles between normal display and full-screen.
    • Some pop-up windows will not display the tab bar and toolbar complete main (just the address section). Also these windows will not usually have the menu bar. You can start a new window using Ctrl + n.

    Assuming that you do not have these problems...

    You can use one of the following methods to view the list of the toolbar, and then select menu bar or toolbar bookmarks here:

    Success?

    Are there other aspects of the appearance that you are having trouble recovering?

  • How can I get the file Library.photoslibrary from Yosemite to open in Mavericks

    Hello!

    I have downgraded from Yosemite to the Mavericks, and I'm moving my files to the Mavericks.

    I have a Library.photoslibrary file opening problem Photo with the Mavericks.

    That's what I tried:

    ILife 11. Installed iPhoto and updated to 9.4.3 worm. Copied from Library.photoslibrary to the Mavericks.

    Could not open the library.

    Suggested a how-to website. Go to the App Store and iPhoto download (from files 'Bought'). The version he was 9.5.1. Tried with the same result, would not open the file Library.photoslibrary of Photos on the Mavericks.

    Would appreciate any help on how I can access/use of the photoslibrary of Yosemite, the Mavericks.

    Thanks for any help!

    AJ

    What version of iPhoto did you use finally to open the library?

    iPhoto cannot downgrade a library, but you can use iPhoto Library Manager to downgrade the library, see this help page: http://www.fatcatsoftware.com/iplm/Help/downgrading%20a%20library%20to%20an%20ea rlier%20version%20of%20iphoto.html

  • How can I get the files of social mobilization to bring up the Adobe Digital Editions software when I hace PC drive installed too

    When I click on a book from uploaded library, it appears in my PC drive app but not Adobe Digital Editions.  How can I go to ADE directly?

    Hi Paul,.

    You must configure the default application to open as ADE. When you download a file of BCAM, select the option to backup the disk rather than directly open. You can right click on the file and choose "Open with." Select 'Choose another app' and ADE. There is a checkbox that says something in the sense of "Always use this application to open files XXXXXX." Once you do this, it will open in ADE.

  • How can I get the files .iso to ext4 in car?

    Hello

    I installed CentOS6.3 (with the ext4 file system) in a HARD drive, where I kept all the .iso image files & I installed ESXi5.0 on another HARD drive. now, I want to get the CentOS HDD .iso files, which I required for installing OS invited in ESXi5.0. so is there a solution?

    Thank you

    Since your Windows laptop you can simply point a vSphere client directly to the ESXi host and log in as root (or point your client vSphere vCenter server).  Then, in "Home > inventory > hosts and Clusters" highlight a VMHost in the pane on the left and from the summary in the right pane tab, identify the listed storage.  Right click on the data store desired and go through it.  From there, you can click on the appropriate icon at the top to download a file or folder.

  • How can I get the file NOT menu to display in the title bar?

    For Firefox I know I can go in: config and set "browser.draw.tabs.defaultDrawInTitlebar" and "browser.draw.tabs.DrawInTitlebar", false, but I have no idea on Thunderbird because I don't know how to access to the about: config page, or if it still exists.

    You can reach everything: config Options > Advanced Options > General > Config Editor.

  • If I use my photos for the screen saver, how can I get the file or the path to display at the top of each photo?

    I love to see the name of the folder on the picture, then I remember where the photo was taken.

    Hello GwynneSmith,
    This thread has been created in the Microsoft Site Feedback forum. the Microsoft moderation team has moved this thread to the files, folders, and search Forum.

Maybe you are looking for