How to properly store multipart messages

Hello all !
How can I properly store a multipart message ?
For example in a database, is it proper to use a structure like that:
(pseudocode)
class Part {
      Set<Part> children;   //  (for multipart message the field is set, else is null)
      [fields of the part or]
      byte[] content;
}or should I stick to the simple case where i have a text message with several attachments ?
in case the message is HTML newsletter how to handle "embedded" images or content, and how is the general case of manipulating such messages ?
Thank you
Edited by: javaUserMuser on Jul 24, 2008 10:18 AM

OMG.... That I DIDNT THINK OF !!!!!!
Man, thats so original, and very simple anyway... and very functional ! Its very good approach I am considering.
But anyway...
If i want to implement efficient search functionality I shall implemement a respective custom word/component index as opposed to native database indices (for the blob). Is this correct ?
Anyway, can u suggest a/the correct way of storing the (plain/nested) parts/data as an alternative of the approach u suggest. THANKS ! :)))

Similar Messages

  • How do I store more messages in my Mail App?

    Only storing last couple of days, before I remember option in settings to store up to 5000 messages?
    So annoying, as search for emails from last week or last month, and got no record of them. Wasting so much time accessing Hotmail search via Safari, or starting up laptop... If this options been removed with ios7 I'll have to change from Apple.
    Really appreciate any help in getting my old storage capability back...Thanks

    I am not at my computer right now, but you probably can find it if you look at the tabs under Mail (in the menu bar)>Preferences.

  • TS3297 iTunes puts up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one. How I can clear that messag

    I've been running iTunes on WinXP for years with few problems.  I have all my iTunes files on an external USB drive. I just bought a new PC running Win7, 64-bit.
    I connected the external USB drive to the new PC and installed 64-bit iTunes on it. When iTunes started up, I pointed it at the iTunes directory in the external drive, using Edit > Preferences > Advanced > iTunes Media Folder Location. It showed a progress bar that it was updating the iTunes Library. I signed in and authorized the new machine. I have one spare authorization.
    Then iTunes put up a message "The item you've requested is not currently available in the Hong Kong Store." I had not requested anything from the HK store at that point, and I have never used any store other than the HK one.
    When I click OK, the iTunes Store page remains blank, apart from saying "iTunes Store" in the middle of the page.
    I went to "View My Account" and pressed the Reset button to "Reset all warnings for buying and downloading items", but that doesn’t fix this particular warning. I also tried Edit > Preferences > Advanced > Reset Warnings and Rest Cache.
    But still, every time I click the “App Store” button in the iTunes Store window, the message appears. If I click the Books, Podcasts or iTunesU buttons, these display normally.  So I’m stuck with being unable to purchase apps, other than through my iPad and iPhone.
    If I move the external drive back to the XP machine, the same thing happens.  If I go to another PC - a notebook running Vista - everything is normal.
    Any idea how I can clear that message?
    Thanks for any help you can offer.

    Further info on my question above.
    I have tried re-validating my credit card, which apparently fixed it for some. 
    I have also tried uninstalling, re-downloading and installing again.
    Neither of these steps fixed the problem.

  • How to read the multipart/realted mime type message.

    hello, sir
    please tell me,
    how to read the multipart/realted message.
    which are the subpart are included in the "multipart/related" message
    i know only "multipart/mixed" and i know how to read ,it contain the subpart ,
    1)text / plain
    2)text / html
    3)multipart/alternative
    a)text / plain
    but i don't know which are the subpart included in the "multipart/related " please tell me.
    thanks

    Today we rely on Simulink to perform parameterization of your designs in two ways:
    Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
    The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.
    To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:
    Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
    Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
    Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.
     

  • How to create multipart message manually in wcf consumptions

    Hi,
    My purpose is to consume simple wcf service through biztalk and I am also able to do this for doing this i have following steps
    step 1)  add -->generated itmes -->consume wcf service      
    through this wizard  i got one .odx file two binding xml  files and some schemas
    step 2) in oxd file i created 3 messages 
    1-msgIn which is a simple type of mesage which is accepting input from our request schema
    2-msgWcfReq- by this message we are sending a request to wcf (but when we are selecting the messagetype for this message we are selecting it form "multipart message type node" inside this node there are some automatically generated schemas when
    we used wcf wizard)
    3-similarly for response message also we are selecting messagetype from "multipart message type node".
    and rest of the mapping we are doing and we deployed the solution and we importing the binding file which was genrated by wcf wizrad.
    so it automatically fill everything for WCF port like pipeline/wcf url/soap action header
    Now My question is if i am deleteing the automatically generated odx file then we don't have those aotogenrated port and schemas which are comming under "multipart message type node" 
    so now how we can achieve the same thing means now i am trying to create same 3 type of message which i discussed above,because if i am trying to create multipart message manually then we don't have any schema type of things inside "multipart message
    type node".
    if this problem is resolved the everything will work for me  because in administration console still i want the same "bindinginformation.xml " file for wcf port bindings.
    Please help me
    Thx
    Manoj

    Hi Manoj,
    You should not delete the auto generated orchestration even do not modify it, as it is stated in msdn.
    The BizTalk WCF Service Consuming Wizard creates in your BizTalk project the BizTalk schemas and types necessary to consume WCF services. The BizTalk types such as port types and multipart message types are created in an orchestration. We recommend
    that you do not modify the orchestration that the wizard creates. Instead, you can add new orchestrations in the BizTalk project for your purposes.
    --------- MSDN
    For Refernce
    In your solution, if you are seperating your schemas project from orchestration project, in that case i personally advise to generate wcf endpoint in your schema project and after adding schema reference in orchestration
    project you manually create the multipart message and a request response port as it will not display in existing port.
    Regards

  • How Should I Properly Store Away My Macbook?

    I'm heading off for a 3-4 month trip and I won't want my Macbook with me. How do I store it away Properly? I already have my Media Backed Up and Software Updated.

    Long-term storage is for 6 months or longer. Since your trip is shorter but still lengthy, I would say that the storage suggestions are optional. Apple says to:
    +If you don’t plan on using your notebook for more than six months, Apple recommends that you store the battery with a 50% charge. If you store a battery when it’s fully discharged, it could fall into a deep discharge state, which renders it incapable of holding any charge. Conversely, if you store it fully charged for an extended period of time, the battery may experience some loss of battery capacity, meaning it will have a shorter life. Be sure to store your notebook and battery at the proper temperature. (See “Notebook Temperate Zone.”)+

  • HT204266 I have some updates due on some Apps I have downloaded but when I try to update I get a message saying that my account is not in the UK store so must switch to Ireland before purchasing. Does anybody know how you change stores?

    I have some updates due on some Apps I have downloaded but when I try to update I get a message saying that my account is not in the UK store so must switch to Ireland before purchasing. Does anybody know how you change stores? I did not do this deliberately!

    Yup! Here:
    http://support.apple.com/kb/HT1311

  • How long does Apple store text messages?  I need old messages from July-Sept 2011

    How long does apple store text messages.  I need old text messages from July - September 2011.  These messages were NOT deleted from phone.  I can only go back as far as July 1, 2012.  Please help, this is important!!!

    Thank you!!!
    What I concluded is that the phone information (with text message content) that we have came from the police department...when they conducted interviews, they asked for their phones and obtained the content, pictures, etc. that way. We also have logs from AT&T with information starting a few months prior to the incident; this information, however, is solely limited to who sent, who received, when, type of data, etc - NO content. I'm assuming that those are the logs that can be subpoenaed after the alloted amount of time, say, 10 days.
    Does that sound correct?

  • How do I store sent IMAP messages to my computer but delete from server afterwards

    I've browsed through the messages on the discussions and seen other people talking about this is different ways.  However, I can't find anyone explaining exactly what settings to change to what.  Basically, once I send an email I'd like to save all of them to my computer but not have them pile up on the server.
    Thanks in advance.

    Hello there, Charlene.
    The information in the following Knowledge Base article, although written for Mountain Lion, is still relevant in Snow Leopard as well:
    Mail (Mountain Lion): Create mailboxes
    http://support.apple.com/kb/PH11740
    You can create a mailbox and choose "on my Mac" as the location. This will allow you to store email messages on your computer instead of the mail server. The steps to do that are as follows:
    You can create mailboxes to organize messages. For example, if you receive messages from friends in a book club, you could create a mailbox to store all the messages related to the book club. You could organize your messages further by creating another mailbox inside the book club mailbox for each author you read.
    Choose Mailbox > New Mailbox.
    Use the Location pop-up menu to choose whether to store the new mailbox on your Mac or on a mail server.
    Type a name for the mailbox, and then click OK.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • How do I get iPhone to store deleted messages in MobileMe trash?

    Here's the scenario: I have a Mac Pro, MacBook and iPhone 4. I use IMAP MobileMe with Mail.app for email while at home, and while I'm away and don't have my MacBook with me, I use the MobileMe web interface. I want all of my deleted messages from these different sources to end up in the same Trash mailbox on the server. I thought I had all of my devices set up to do that, but what's happening now is that when I delete a message from the iPhone, it goes into a folder called "Deleted Messages" in my MobileMe folders list.
    On my Macs I have "Store deleted messages on server" checked, and "Erase deleted messages" set to "never". On my iPhone I've set the trash to "On the Server > Deleted Messages (.Mac)". This description appears next to the trash can icon, which I assumed would be where my deleted messages from Mail.app are going. But this doesn't seem to be the case.
    Any ideas?

    I haven't tried this, but browsing in private browsing (Tools > Start Private Browsing) while doing will probably keep Firefox from storing which sites you visited. Clearing the last hour's history will probably do the trick too.

  • How to make numbers in message text input  fields left aligned?

    Hi Friends
    I have completed one of my task .but getting result right side of the field.
    how to make numbers in message text input  fields left aligned?
    Thanks
    Aravinda

    Hi ,
    Sorry for late replay i am trying this alos not set that page....
    pageContext.forwardImmediatelyToCurrentPage(null, true, null);
    and one more that kff field working is fine for ex display any text pled displayed properly and only problem is not set the value and HrSitKeyFlex6 and HrSitKeyFlex7 fields are perfectly get the values but not pront HrSitKeyFlex8 that only my issue....
    Regards,
    Srini

  • How can i display the message

    public class Userdefined extends Exception {
              Userdefined(String sparam){
              System.out.println(sparam);
              Userdefined(){
         private static int acno[]={100,105};
         private static double bal[]={100.00,200.00};
         public static void main(String args[]) {
              try{
              for(int i=0;i<2;i++)
                   System.out.println("ACCCCNO------>"+acno[i]+"BAl------>"+bal);
                   if(bal[i]<150.00)
              Userdefined udexp=new Userdefined("bal less");
              throw udexp;
              catch(Userdefined e){
                   System.out.println("--->"+e);
    How can i display the message "less amt" using my parmeterized constructor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    VinayTK wrote:
    How can i display the message "less amt" using my parmeterized constructor.Erm ... what? You can't --- at least not with the stuff you've got there.
    A properly formed question, with some idea of what you're trying to accomplish would be a huuuuge help.
    Winston
    BTW: Congratulations. At my age, 'first's in computing are rare; but it's definitely the first time I've seen an Exception class with a main() method.
    Edited by: YoungWinston on Sep 1, 2009 9:46 AM

  • Hi! I have a library of around 1000 songs on my iTunes, I recently synced my phone and all was lost, my partner has the same songs on hers with a different sign in, but not backed up anywhere, any suggestion on how I can store her tunes in my account ???

    Hi! I have a library of around 1000 songs on my iTunes, I recently synced my phone and all was lost, my partner has the same songs on hers with a different sign in, but not backed up anywhere, any suggestion on how I can store her tunes in my account ??? Then sync them to mine? When I sign her phone into her account I get a message warning that if I sync the dogs on her phone will be replaced by the ones in the library! But as there are no songs there I'm reluctant to continue!!! Please help this non techi guy.!!!!!

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How  can i Store a file using in a servlet?

    This is because i have a Applet<->Servlet comunication.....
    With the following application i can store a image in a file in the directory that i indicate.....
    class rec_image
    public static void main(String h[]) {
    Connection con = null;
    Clob cl;
    JPanel photo;
    FileOutputStream file = null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@112.21.2.233:1521:db_name","user","password");
    con.setAutoCommit(false);
    String query = "Select Pict from Pictures where ID_Pict = '180'";
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    if ( rs.next() ) {
    //Get the GIF
    byte[] bytes = rs.getBytes(1);
    file = null;
    file = new FileOutputStream ("leslie.gif");
    file.write(bytes);
    if (file != null)
    file.close();
    } catch (IOException e) {
    String err = e.toString();
    System.out.println(err);
    } catch (Exception e) {
    String err = e.toString();
    System.out.println(err);
    } finally {
    //if (file != null)
    Now...i need to do the same...but....using a servlet that is called by a applet....but this is not functioning :( ,ie, no file is stored in the directory that i indicate....
    The servlet would recive the query from the applet and the servlet would store the image file in the directory that i indicate....but it is not working correctly...something is wrong.......
    I not obtain any exception ...is like the servlet wasn't executed.....
    I think it...because i dont obtain the System.out.println coments (that i put in the servlet code) in the console and any file is stored :(.....
    Somebody could help me please?
    This is a snnipet of applet code.....
    class store_pict extend JApplet {
    //Some intructions
    private void Store_Picture() {
    try {
    servletURL_bytes = new URL("http://112.21.2.233/servlet/coreservlets.obt_bytes");
    } catch(MalformedURLException e) {
    System.out.println("1er. Error en el m�todo Init() en la construcci�n de la URL");
    System.out.println(e);
    } catch(Exception e) {
    System.out.println("2do. Error en el m�todo Init() en la construcci�n de la URL");
    System.out.println(e);
    String query = "Select Pict from Pictures where ID_Pict = '180'";
    make_servlet_connection_bytes(query);
    private void make_servlet_connection_bytes(String query) {
    System.out.println("Start applet-servlet to store picture");
    ObjectOutputStream outToServlet = null;
    byte [] query_Array_bytes = null;
    try {    
    //Setup servlet connection
    URLConnection servletConnection = servletURL_bytes.openConnection();
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true); // to allow us to write to the URL
    servletConnection.setUseCaches(false); // to ensure that we do contact
    servletConnection.setDefaultUseCaches(false);
    //Send output to servlet
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream");
    outToServlet = new ObjectOutputStream(servletConnection.getOutputStream());
    outToServlet.writeObject(query);
    outToServlet.flush();
    outToServlet.close();
    } catch (Exception e){
    System.out.println("Error en el m�todo make_servlet_connection()");
    e.printStackTrace();
    System.out.println("End applet-servlet to store picture");
    This is my servlet code:
    package coreservlets;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class obt_bytes extends HttpServlet {
    Connection con = null;
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    //aren't sending a get
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    System.out.println("Start Servlet");
    ObjectInputStream inFromApplet = null;
    ObjectOutputStream outToApplet = null;
    String inString = null;
    FileOutputStream file = null;
    try {
    System.out.println("Start Servlet");
         //Read string from applet
         inFromApplet = new ObjectInputStream(req.getInputStream());
         inString = (String) inFromApplet.readObject();
         inFromApplet.close();
    System.out.println("Read string from applet = " + inString);
    String query = inString;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    con= DriverManager.getConnection("jdbc:oracle:thin:@112.21.2.233:1521:db_name","user","password");
    con.setAutoCommit(false);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery( query );
    //Get the GIF
    byte[] bytes = rs.getBytes(1);
    file = null;
    file = new FileOutputStream ("C:/jakarta-tomcat-4.0.3/webapps/ROOT/images/leslie111.gif");
    file.write(bytes);
    if ( file != null )
    file.close();
    } catch(Exception e) {
    System.out.println("Not Stored File");
    e.printStackTrace();
    System.out.println("End Servlet");
    Please help me.....
    Thanks in advance ...
    Mary

    Greetings,
    //Setup servlet connection
    URLConnection servletConnection = servletURL_bytes.openConnection();
    ...Here's the first problem: your servlet is an HttpServlet but your applet is treating it as though it is a GenericServlet. The above should correctly be:
    HttpURLConnection servletConnection = (HttpURLConnection) servletURL_bytes.openConnection();Note: using a "generic" URLConnection will, of course, "work". However, by instead using an HttpURLConnection (to communicate with an HTTP resource), your applet will also gain significant ease in working with the HTTP protocol - parsing server responses (remember, servlets run as extensions, not replacements, of their hosting servers), for example - as in any one of, currently (http://www.w3.org/Protocols/rfc2616/rfc2616.html), 40 possible status codes... - not to mention...
    servletConnection.setDoInput(true);
    servletConnection.setDoOutput(true); // to allow us to write to the URL
    servletConnection.setUseCaches(false); // to ensure that we do contactHere's a subsequent problem: your servlet is expecting the data to arrive by way of... er... "POST" (no pun intended ;). However, the default 'HTTP request method' is "GET". So here should also be:
    servletConnection.setRequestMethod( "POST" );However, it should be noted that in the case of "POST"-ing file data, it must be sent as a multipart message and this can be a literal "pain in the neck" to manage. Therefore, it is far better to HTTP "PUT" the file to the server - which can easily be done as is coded in your applet - though your servlet must, in turn, be refactored to respond to such a request. Of course, all of this "PUT"-ing and "POST"-ing can be dispensed with entirely by simply refactoring your servlet to be a GenericServlet, though you will also have to devise your own protocol for communicating (e.g. success or failure) between the tiers...
    Please help me.....I hope this helps.
    Thanks in advance ...
    MaryRegards,
    Tony "Vee Schade" Cook

  • How can I store received email in a folder on my iPad *

    How can I store received email in a folder on my iPad *
    I am trying to save certain messages on my iPad but don't know how to make a folder with email!

    You can only add folders to the email account if it is an IMAP account. If you see an EDIT button at the top of the window when you are in the email account - where you can see your inbox, sent and trash folders - if there is an edit button at the top of that window - you can tap that and then an Add Mailbox option appears at the bottom of the window.
    If you do not see that edit button, you do not have an IMAP account and you cannot add folders.

Maybe you are looking for