How to extract the mime type using HttpExchange?

Hi,
I am using Sun httpserver to implement an HTTP Server. I am implementing the class HttpHandler and so implementing the method,
public void handle(HttpExchange t) throws IOException
}I just need to know, in the above method, is there a proper way to know the Content-type to know the mime type? Or I would have to traverse through all the headers?
Regards,
Kashif

[HttpExchange.getRequestHeaders()|http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpExchange.html#getRequestHeaders%28%29] returns a Map...

Similar Messages

  • How to get the 'mime-type' of a Resource accessed via WebDAV

    Hello,
    When a document is uploaded into a folder which is managed by a WebDAV RepositoryManager we don't see a Property 'mime-type' or something like that.
    Our code:
    <i>IPropertyMap lijstProp = tempResource.getProperties();</i>
    In the list there is no Property 'contenttype' or something like that!
    This is a bit of a surprise to me since it seems to me a very relevant Property of a Resource.
    How can the mime-type/contenttype of a Resource managed by a WebDAV Repository Manager be determined?
    Kind regards,
    Maarten Rutten

    Hi Thilo,
    We access the Resources via API.
    When I use "IPropertyMap lijstProp = tempResource.getProperties();" I assume that ALL the available properties are in 'lijstProp'.
    (is this correct?)
    I don't have the Property "contenttype" available in 'lijstProp'.
    A workaround could be that when adding documents to a folder via API's, we also should set this Property via API's.
    But when documents are added directly into the WebDAV folder we don't have that option. So, when we find a Resource with the Property 'contenttype' missing the only option I see is to 'calculate' the contenttyype based on the extension of the Resource.
    Do you agree?
    Kind regards,
    Maarten

  • How to determine the MIME types of the files?

    I'm making an application, in which I've to upload the files to the database. Now I want to insert into the database the MIME type of the files. Now how can I know that which type of the file is having which MIME type?
    where can I get the list of all supported MIME types?
    Even if I get the list, then every time I update the file in the database, so every time I have to check the file extension and then insert the MIME type...
    this seems to be a tedioius job..
    Is there any simple way to do this?

    I could ask "supported by what?" but I assume you will
    be the one supporting them. Here's a link to the
    latest list of registered MIME types.HERE's the link...
    ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types

  • How to get the MIME type of the given file in R/3

    Dear Experts,
    Please tell me the FM or Class to get the given file MIME type in R/3 . I am using GUI_upload Function module to upload the file in R/3 .
    Edited by: balaji ramadas on Jan 16, 2009 5:39 AM

    Thank you Prosenjit I m using this FM   CV120_GET_MIME_TYPE
    to get the MIME type of the file
    regards,
    Balaji.R
    Edited by: balaji ramadas on Jan 19, 2009 9:24 AM

  • How to retrieve the content type used in a document library (C# - Client Model).

    Hello,
    I need to know if it's possible to retrieve the content type used in a document library, so I can know the columns active and used in this document library. I am using the Client Model in C#.
    Thanks

    First, retrieve your document library as a List object. Then, use the
    List.ContentTypes property to iterate through all the content types assigned to the list.
    Blog:
    blog.beckybertram.com |
    RSS | @beckybertram |
    SharePoint 2010: Six-in-One

  • How to get the mime type of the workflow attachment attached to workitem id

    Hi Experts,
    I can attach different types of attachment to the workitem id, lets suppost the attachment type attached is pdf, for this attachment I have an requirement to send the mime type as well. In this case the mime type is 'application/pdf' for pdf files.(for text file it is 'text/plain' and for zip file it is 'application/zip' and so on)
    Do I have any place in ABAP world where I can get the mime type for different types of attachments.
    I dont want to hard code the mime types, and I have checked the transaction 'SMW0', but not sure if this is the correct place to get the mime type.
    Do you see any other way or tables which stores all these mime types.
    Any help/suggestion would be appreciated.
    Thanks and Regards,
    Neerup.

    Hello,
    Perhaps this can help:
    http://help.sap.com/saphelp_nw04/helpdata/en/ad/ebe5cc1d75aa43a2871717d76f475d/content.htm
    If you want to know the table name, turn on tracing (ST05) when accessing the MIME types.
    regards
    Rick Bakker
    Hanabi Technology

  • How to get the Mime Type of the file?

    Hi Everyone!,
    I want to upload a random file into my table as a BLOB and simultaneously want to fill the respective another column with its MimeType. Earlier I used Oracle Apex for this, but due to my new requirement I need to make this happen with the help of PL SQL and Forms. Could you help me in getting how we can upload the file and most importantly, how we can get its Mime-Type.
    My chosen file can be of any type; it can be doc ,pdf,txt,xls ,gif or any other format.
    If you could provide the example with your reply then it would be great.
    Thanks
    Harbinder

    hi
    for that u have to use webutil.
    declare
          f varchar2(100);
    begin
         f := webutil_file.file_open_dialog();
         if f is not null then
              :doc.doc_name := f;
              end if;
         end;and
         DECLARE
    filename VARCHAR2(256);
    BEGIN
    filename := CLIENT_GET_FILE_NAME (File_Filter => 'jpg (*.jpg)|*.*|');
    READ_IMAGE_FILE(filename, 'jpg', 'image');
    END; sarah

  • How to fix the "MIME types" problem  !

    Hello !
    How to fix the problem of "MIME types", Windows doesn't want to keep the APPS by default !!!
    When I try the application by default (for ex. right clic on .PSD files and "open with"), then I validates the selection program (Photoshop.exe), it does not appear in the selection of programs by default in windows!
    Result, even dynamic objects no longer open in my applications and all adobe files icon don't appear in explorer
    Thx

    I find a solution who works for me (Win7 64bit) !
    Use a Registry cleaner (ccleaner) and kill old file format entry !
    Now restart association with a .AI file, because the way to .exe is in another place like other apps !
    Try this:
    First, right click on your illustrator apps icon (desktop or Start menu) and choose "open the file location" and copy the dir ("C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for me )
    Right clic on your .AI file and select "Open with", now click on "browse" to "C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows" for 64bit system.
    "Windows" say "you've got problem with registry file association" the correction's automaticatly and the illustrator icon appear in the list of default apps.
    Select and valid him
    Now, do the same for all your "unknown files type" with the good apps !

  • How to extract the excel file using web dynapro

    Hi Expert,
       I want to know how to generate an excel file to extract the internal  data. Please give me your help.
      Thanks in advance.

    I think you you can use File download UI element. Refer following link for more info:
    [FileDownload|http://help.sap.com/saphelp_tm60/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    Regards,
    Saket

  • How to extract the data by using function module?

    hi experts,
    what are the steps i have to fallow to extract the data from R/3 by using FUNCTION MODULE.
    thanks & regards
    venkat

    Hi,
    Extracting data from R/3 extract structure thru function modules
    You can proceed with create function module using SE37, thereu2019s sample in system RSAX_BIW_GET_DATA_SIMPLE,
    You need to know the logic how to populate the structure,
    after that RSO2, create datasource specify extract structure and
    function module,
    activate and replicate to bw.
    Chheers
    Raj

  • How to know the Control type using event param???

    Hi,
    I wrote a function on MOUSE OVER EVENT. I called this
    function from a LIST and DATAGRID using addEventListener.
    Now i got a requirement like on event fire.. i wanna alert
    the control type i.e., whether the action fire from LIST or
    DATAGRID. I can create two different function for both LIST and
    DATAGRID. But requirement is like cannot reapeat the code.. code
    minimization.
    Is there any property to know the type of control(Like its
    LIST or DATAGRID) using event parameter??
    Thanks & Regards
    PRatap

    You can try using flash.utils.describeType or
    flash.utils.getQualifiedClassName on event.target property and
    figure out the control type.

  • Anyone figured out a way to use JWS without needing the MIME type preloaded

    Anyone figured out a way to use JWS without needing the MIME type preloaded on the client's computer?
    Why is it not server-side loading? How can I force a load of JWS and the MIME-type?

    when you install web start, the mime type jnlp is associated with WEBstart.
    The WEB start home page has code to request an
    install if web start is not on the user system.
    On the web server, of course you need to specify the association between a
    .jnlp file and the mime type. This is in the configuration of the server.
    It would be nice if standard ISP's provided that for user directories.
    Anyone think AOL would do this?
    After all it should not cost anything like installing servlets.

  • How to change the NAT type to Open on a Imac using bridged connections

    Hey everyone I have a problem. I play xbox live with my friends and i just moved and dont have a wireless adapter anymore. so i have bridged connections with my imac and xbox via ethernet. It works perfectly, but the only problem is that when i connect it say that my NAT type is strict. To play with all my friends i need a open NAT type. Does anyone know how to make the NAT type on the Imac open. And i do have a D-link router model DIR-625. When i called D-link they said to port forward, i did and it still didnt work, they said it must be the fire wall on the mac, microsoft said the same thing, that it might be the fire wall. I checked the fire wall and it said "All Incoming connections are allowed".
    I would really much appreciate it if someone helped me. Thank you!

    Yes, most likely. Microsoft has provided a list of XBox LIVE!-compatible routers. Since the OS X Internet Sharing feature is limited, there is no way to configure port mapping or placing the XBox in a DMZ with it. Typically, you either use a compatible router or configure port mapping/DMZ for non-compatible routers.

  • How to find the file type without the file extension using indesign javascript (.jsx)

    hi,
    How to identify the file type (eg: InDesign or Quark) without knowing their file type. How can we find what kind of file is that??? without their extension like ('.indd','.qxd') before import to the document...

    Hi subha_oviya,
    Take a look at the file filtering section in the InDesign CS3 sample script ImageCatalog.jsx to see how to look for file types. I'm assuming that you're using InDesign CS3, and that you're using the Mac OS--you didn't say.
    Thanks,
    Ole

  • How do I set the mime type for an attachment to "application/zip"

    I'm sending out an email with a zip file as an attachment. The following code works fine, but the Mimetype for the attachment is set to "application/octet-stream"
    FileDataSource fds = new FileDataSource(zipname);
    DataHandler dh = new DataHandler(fds);
    MimeBodyPart mbp2 = new MimeBodyPart();
    mbp2.setDataHandler(dh);
    mbp2.setFileName(fds.getName());
    I would like the mime type to be application/x-zip. Unfortunately I seem to need a data content handler for this mime type as I get this exception.
    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/x-zip
    Building a date content handler in the activation framework seems like a lot of work to do a very simple thing. Am I missing something obvious? Is there a simple way to do this?

    I found the solution after much chasing around. The default mimetypes file that comes with the activation framework does not list zip.

Maybe you are looking for

  • Moved computers - Error messages - podcasts won't sync - multiple problems

    I just moved my itunes and ipod from a macbook to a PC (I love the apples but I can't afford to buy them). When I plug in my ipod I get two very similar error messages that must be cleared before my ipod will sync (which is very annoying if you're in

  • How to use Labview drivers for USB-CAN Adapter

    Hi, I just recently started working with CAN and I have a PCAN-USB adapter. I'm trying to create a programme for monitoring a series of CAN based devices and I've found Labview drivers at the link below. However, I'm not really sure how to start. I h

  • Sharpening not applying in iPhoto '11

    When I apply sharpening to my pictures, I can see it being applied in the edit view, but when I switch out of edit view the sharpening is "gone".  Am I doing something wrong?  Thanks, sherri

  • Best practice for deploying the license server

    Was wondering if there is a best practice guideline or a rule of thumb out there for deploying the license server. For instance, is it better to have one license server and all your products connect to that, dev, QA, prod. Or is it better to have a l

  • 10.1.3.1 and standalone RMI client

    I'm migrating our J2EE applications from 10.1.2.0.1 to 10.1.3.1.0. I also have a custom JAAS login module that is used by our applications. I have the login module working successfully and web applications that can call EJBs. But I am unable to get a