Saving a file in a particular folder over the tomcat server

I have a java class in the background of a JSP which creates an XML file and saves it.
Furthermore another class picks that file and processes it. While running this program on my local computer it is obviously working fine but in order to run it on a tomcat server or for that matter any server, I want it to save the XML file in a particular folder, for example:
tomcat_home/webapps/myapplication/ xmlfolder / something. xml
so that my other class can easily pick up the file and I dont need to change the location each time I change the server.

You can get the context root(the place from wher the aplication is running) of your application and then save the file somwhere, but i >>woulden't recomend that. But this is what you are looking for.How ?
You can also just save the file, it will be saved in a temp directory. (use this only if the file is a temp file not for storing purposes)Just saving the file somehow doesnt work for me as the folder where a class is saving a file by default is somehow different from the folder where another class is trying to pick a file by default. Even if I give no path
Other option is just to configure a tomcat system variable that specifys an folder. You can get that property from your application and >>then save the files there.Im not able to consider this one because the application will be put on different servers by different people later so they would all then need to configure their systems just to read a file. I was sure there were better ways. :(

Similar Messages

  • How to check whether file exist in a folder at the application server

    Hi to all experts.
    if suppose there is a file at the application server test.txt my requirement if the one more file is created of the same name before overwriting the file a warning message is to displayed to the user that the file already exist .
    how to do it

    HI Mohammed,
    use The FM DX_FILE_EXISTENCE_CHECK
    or static class CL_GUI_FRONTEND_SERVICES=>FILE_EXIST
    For more info
    search file in application server
    application server
    hope it helps you.
    Regards!

  • Upload file to a particular folder in UCM

    I want to upload file to a particular folder location in UCM.
    When I am uploading it is going to the default location though i programmatically have set the folder path
    I am using Adf application in Jdev 11.1.1.3
    As i am new to UCM i do not have idea of whether to define the location at ucm level or in our program
    Below is my code like this
    public void checkInContent(TransferFile file){
    UploadContentVORowImpl row=(UploadContentVORowImpl)this.getUploadContentVO1().getCurrentRow();
    IdcClient client= UCMRepositoryOperations.getIdcClient();
    DataBinder binder= client.createBinder();
    binder.putLocal ("IdcService", "CHECKIN_UNIVERSAL");
    binder.addFile("primaryFile", file);
    String fileType=file.getContentType().substring(0,file.getContentType().indexOf("/"));
    int contentId= new SequenceImpl("UCM_CONTENT_ID_SEQUENCE",getDBTransaction()).getSequenceNumber().intValue();
    binder.putLocal("dDocID", contentId+"");
    binder.putLocal("dDocName", file.getFileName());
    binder.putLocal("dDocTitle", file.getFileName());
    binder.putLocal("dDocType","DigitalMedia");
    SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
    binder.putLocal("dInDate",sdf.format(row.getFromDate().dateValue()));
    binder.putLocal("dOutDate",sdf.format(row.getToDate().dateValue()));
    binder.putLocal("xScope",row.getScope());
    if(row.getStateId()!=null){
    binder.putLocal("xState", row.getStateId().toString());
    if(row.getDistrictId()!=null){
    binder.putLocal("xDistrict",row.getDistrictId().toString());
    binder.putLocal("dLocation", "/Contribution Folders/sahaj/content/loginPageNews");
    binder.putLocal("dAuthor", "Test");
    binder.putLocal("dSecurityGroup", "public");
    binder.putLocal("blDateFormat", "dd-MM-yyyy HH:mm:ss");
    ServiceResponse resp=null;
    String response=null;
    try {
    resp = client.sendRequest(UCMRepositoryOperations.getContext(), binder);
    } catch (IdcClientException e) {
    ucmAMLogger.severe(e);
    try {
    response=resp.getResponseAsString();
    resp.close();
    } catch (IOException e) {
    ucmAMLogger.severe(response);
    ucmAMLogger.info(response);
    }

    The xContributionFolder should be an ID, not a file path.
    To determine the correct ID, this PL/SQL function may be useful :
    function f_get_folder_id ( p_folder_path in VARCHAR2)
    return NUMBER
    is
    v_parent_folder_id NUMBER := 429910249369000002 ; -- ID of 'Contribution Folders/Root' collection
    v_folder_name VARCHAR2(255);
    v_folder_path VARCHAR2(32000);
    pos_next_separator NUMBER;
    CURSOR c_get_folder_id ( p_parent_folder_id in number, p_folder_name in varchar2 )
    is
    SELECT dcollectionid
    FROM collections
    WHERE dcollectionname = p_folder_name
    AND dparentcollectionid = p_parent_folder_id;
    begin
    v_folder_path := p_folder_path ;
    -- strip first '/'
    if ( substr(v_folder_path,1,1) = C_FOLDER_SEPARATOR ) then v_folder_path := substr(v_folder_path,2); end if;
    pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
    while ( pos_next_separator > 0 )
    loop
    v_folder_name := substr(v_folder_path,1, pos_next_separator - 1);
    v_folder_path := substr(v_folder_path,pos_next_separator+ 1);
    open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
    fetch c_get_folder_id into v_parent_folder_id;
    close c_get_folder_id ;
    pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
    end loop;
    v_folder_name := v_folder_path;
    open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
    fetch c_get_folder_id into v_parent_folder_id;
    close c_get_folder_id ;
    dbms_output.put_line('Found :' ||v_folder_name||' id '||v_parent_folder_id);
    return v_parent_folder_id;
    end f_get_folder_id;

  • What happens to my files on creative cloud folder after the end of my subscription?

    What happens to my files on creative cloud folder after the end of my subscription?

    Creative Cloud Help | Creative Cloud / Common Questions
    "What happens to my files in the cloud if I cancel or downgrade my membership?
    Your Creative Cloud files are stored on your desktop as well as on the Creative Cloud servers. If you cancel or downgrade your paid membership, you will still have access to all of the files in the Creative Cloud folder on your computer and via the Creative Cloud website.
    Your account will be downgraded to a free membership, which includes 2GB of storage. If you’re using more than 2GB of storage, you will not be able to upload any new files to the cloud until the amount of online space used in your account drops below your allotted amount.
    If you are over your storage limit, you have 90 days to reduce your online usage or you may lose access to some or all of your files saved on the Creative Cloud servers."

  • Re Time Machine I have an external  hard drive with files I backed up manually over the past 2 years 1TB of memory. I am finally taking the leap to use Time machine to back everything.   will I have to reformat that drive, thus wiping my previous bac

    Re Time Machine
    I have an external  hard drive with files I backed up manually over the past 2 years 1TB of memory.
    I am finally taking the leap to use Time machine to back everything.
    will I have to reformat that drive, thus wiping my previous back ups?
    can I split it the drive in two partitions?
    Also
    as I have two separate Macbook Pro's- one older than the other.
    OSX 10.68
    the other is
    OSX 10.75
    can I back them up separately?
    or even synch and merge files and folders etc? between the two?

    You CAN use a drive with files already on it to store Time Machine backups. But long term, that is not recommended. You do not need to reformat or re-partition the drive to do this. Once Time Machine Backups are established, you could remove the old files.
    But do not delete Time Machines files with the Finder -- that can cause it to lose its place and lose everything.
    With the cost of backup drives under US$100, it might be a better idea in the long run to get another drive. Best results from Time Machine is a drive about 3 times larger than the drive(s) you are backing up.

  • File not found:  includes/common/lib/file_upload/KT_FileUpload.asp Please upload the includes/ folder to the testing server.

    The cooperative I am a part of have a homepage made with Dreamweaver several years ago. Suddenly some of the pages stopped working with this error message:
    File not found: 
    includes/common/lib/file_upload/KT_FileUpload.asp
    Please upload the includes/ folder to the testing server.
    I checked, and the file is actually missing from the web server. Do i need to purchase Dreamweaver to download this file, and is this a path worth pursuing?
    Dreamweaver version: I don't know which or how to check this, could check if given the proper instructions.

    The page that you have shown uses one of the InterAkt extensions for Dreamweaver. Unfortunately, InterAkt was bought out by Adobe who in turn did nothing with it. The latest version was about 5 years ago and was called ADDT.
    Maybe someone here can help you Friends of Interakt: Home Page

  • EML files sitting in queue folder on SharePoint 2010 server

    Okay, so the incoming email is actually making it to the SharePoint 2010 server.  I actually sent 4 emails from my outlook to the sharepoint site library email.  the emails are inside of the queue folder on the sharepoint server.  Why would
    this be?  and tje emails all satrt off with NTFS_...

    Hello,
    Same here as well. all mails were going to sitting in queue folder prefixed with NTFS_.
    Then I did a telnet {FQDN} 25
    helo {server FQDN} 
    mail from:{your email address} 
    rcpt to:{email address of email enabled library} 
    give 250 success code if everything looks great.
    In my case it gave me 
    501 5.5.4 
    then checked the SMTP Server Domain , was different then changed to correct one it worked fine. 
    Regards
    Yogesh
    YOGESHA H P(MCTS)

  • Browse folder in the application server

    Hi there,
    In a program, I need to create an output file, and to save it either in the applictaion server or in the presentation server.
    But I want the user to be able to choose the folder where to save it, not the file itself. Browsing the Web I have found a method of a class, the cl_gui_frontend_services=>directory_browse, by means of which I achieved displaying a screen to select a folder in the computer.
    But I couldn't find a function module for displaying a screen for the user to choose a folder from the application server.
    Sending an 'A' in the parameter i_server in function module F4_DXFILENAME_TOPRECURSION won't work, since the window displayed is to choose a file and not a folder.
    Thanks a lot in advance.
    Regards,
    Ignacio

    SELECTION-SCREEN BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
    PARAMETERS : p_aps LIKE rlgrap-filename MODIF ID pth .
    SELECTION-SCREEN END OF BLOCK 002.
    DATA : path_name(150) TYPE c.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_aps.
      SUBMIT rs_get_f4_dir_from_applserv AND RETURN.
      IMPORT path_name FROM MEMORY ID 'PATH_NAME_SDL'.
      p_aps = path_name.
    [Retrieve application server file names in F4 help|http://searchsap.techtarget.com/tip/0,289483,sid21_gci943422,00.html]
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
    PERFORM application_server_path.
    *& Form application_server_path
    FORM application_server_path.
    IF p_read = 'X'.
    *& Selecting file from server on pressing f4
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = '.\'
    filemask = ' '
    IMPORTING
    serverfile = p_file1
    EXCEPTIONS
    canceled_by_user = 1.
    ELSE.
    MESSAGE 'F4 is only valid for transfering data from Server to PC' TYPE 'S'.
    ENDIF.
    ENDFORM. " application_server_path

  • I want to write in a XML file which is located on the TOMCAT server

    hello all,
    can anybody tell me or give me code snippet for writing some data through my application i.e from client side on te file which is located on the TOMCAT server(especially XML file).
    tell me how can i do that?
    it is urgent
    cya
    sush

    Hello sush,,,,
    I am sending you some API / classes that will definetely help you for writing XML file through java.
    1) TransformerFactory.newInstance();
    2)Transformer serializer
    3)StreamResult
    4)serializer.transform(source,result);
    5)DOMSource
    From Vikas_khengare
    [ [email protected] ]

  • Where can I find a list of NI-DAQ functions supported over the RDA server?

    Hello,
    I am developing an application in Microsoft VisualC++ for PXI6071E MIO card remotely using RDA server.
    What I found out is that not all the functions described in the "Traditional NI-DAQ Function Reference Help" shipped with NI-DAQ version 7.0 are supported over the RDA server (e.g. Init_DA_Boards, or AO_Configure).
    Is there any document available where the functions supported by the RDA server are listed? It will help me a lot instead of manually executing all the needed functions and building this list by myself.
    Thank you in advance,
    Silvius
    Silvius Iancu

    Hello Sarah,
    Thank you very much for the link.
    Based on this article I included the easyio.h and easyio.lib from LabWindows/CVI into my VC++ project and I managed to perform the needed operations using Easy IO function calls.
    As a result of my own tests, the Analog Input functions provided by nidaq are not supported by the RDA server, but the General Purpose Timer/Counter functions are well supported.
    Hopefully the future versions of NI-DAQ will be fully supported by the RDA server.
    Thank you for your help,
    Silvius
    Silvius Iancu

  • If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    You certainly can.
    Be aware that the emails you move to local storage ("on my Mac") will be the only copies that remain.

  • How to move xml files to a particular folder?

    I have made XML forms for new which is having approval feature.
    Now i want that  after the approver approves the news ,the respective xml file of the approved news should move to a particular folder defined by me in KM.
    Is it possible....?If yes, how?

    Hi
    Other way of achieving this is to create a repository service which listens to the publish event. You can write the code to move document in the received method of repository service. If any document is published, event will be triggered and the service will be invoked, the code to move the document will be executed.
    Check the link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30143cc1-d176-2a10-55a3-ea498211e424
    Regards,
    Yoga

  • How do I share a folder over the internet with Mountain Lion server?

    I am new to using formal servers.  In Snow Leopard I was able to use web sharing to serve a small website and if I wanted to share a folder with someone I would  just provide the person I wanted to share a file with the path to the file inside the sites directory.  With Mountain Lion this functionality was removed from the sharing section of system preferences.
    I purchased mountain lion server and was able to restore the website serving ability, but I haven't been able to figure out how to share a folder.  I am still looking over what documentation I can find, but for the most part it just tells me to set up the services without telling me how.  Any assistance would be helpful.  Networking is not my area of expertise.
    Best Regards,
    David Finell

    I purchased server to assist with this as I am unfamiliar with the command line protocols for using apache.  Because of the UNIX architechture of OSX and I presume apache, I am uncomfortable using the command line for fear of causing serious problems.
    Unfortunately, the documentation that I have seen for mountain lion server is wanting in either its completeness or layout/functionability.  To summarize the server instructions as I understand them.  It just says to configure it and my system to meet my requirements without telling me how.
    I am confident that both the apache command line and server are capable of accomplishing what I was able to do before under snow leopard.  I just haven't figured out how.
    I was able to provide a link to family and clients like http://ipaddress/~user/folder
    This no longer works.

  • How do I force a file download from a folder above the root?

    I am new to ColdFusion and need some help. I set up a virtual folder on my website and then mapped in the CF9 admin panel to a "Docs" folder above my root, where I would like to store sensitive documents. CF tags are enabled.
    I know that my mapping is set up correctly, because when I set up a cfm page with the following code, I can successfully download the file:
    <cfheader name="Content-Disposition" value="attachment; filename=Calendar.pdf">
    <cfcontent type="application/pdf file=/Docs/Calendar.pdf">
    But what I need is to create one cfm age that will be able to handle downloads of multiple files types and names from the folder above my root.
    I then found Duke Snyder's solution on an older forum for the "click link and download file" question where he suggests making a "download.cfm" page with the following code:  I did this, and named the file "download.cfm"
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "foo/bar" file = "/Docs/#Url.FileName#">
    Then Duke suggests: "Now I pass the FileName through the Url and it WILL ask if you want to open or download the file. We accomplish this by making up an eronious file type."
    I then set up a password-protected page on the site that lists the titles of a number of documents, with links to the virtual folder, where they can be downloaded.  One of the links, which goes to "Calendar.pdf" I constructed as: "download.cfm?FileName=Calendar.pdf"  When I click on the link, I get the popup box that says "Do you want to open or save this file?  With the name listed as: "download.cfm?Filename=Calendar_pdf"
    When I click "Save", I get the message: "Internet Explorer cannot download download.cfm from www.... Internet Explorer was not able to open this Internet site.  The requested site is either unavailable or cannot be found. Please try again later.
    I must have constructed the link incorrectly. Any ideas?  Thanks in advance for your help.

    I am trying to force the download of pdf files from a folder above the root.  The file below is named "download.cfm"  I pass the name of the file (Calendar.pdf) in the URL link, as follows: download.cfm?filename=Calender.pdf
    In the ColdFusion admin panel, I mapped a folder in the root "Docs"  to point to a folder with a different name above the root.   I have tried the code below, which was generously supplied by another member of this forum, but it does not seem to recognize the CF mapping. Do I need to use another CF Tag for the mapping to working correctly?
    <cfsetting enablecfoutputonly="yes">
    <cfheader name="Content-disposition" value="attachment; filename=""#Url.FileName#""">
    <cfcontent type = "application/pdf" file = "/Docs/#Url.FileName#">
    Thanks for your help

  • Saving an Image to an Oracle Database over the Internet

    I would like to know how to transfer an image over the Internet and save that image to an Oracle Database. That is I am trying to make it so that a user can connect to the Internet and select an image file form their PC in TIFF, JPEG, or some other format. Next, I would like to save this image to an Oracle 7.3.4 Database in a LongRaw data type. This image will need to be save into a certain record in a table that I created. In the next few months we will be upgrading to Oracle 8 that uses Blob data type. Any one who knows how this can be done, please let me know.

    Yes, that's right. Here is the pertinent code:
    In the flax app:
    private function captureImg(imgEnc:IImageEncoder):void { 
    var ohSnap:ImageSnapshot;ohSnap = ImageSnapshot.captureImage(img, 0, imgEnc);
    textArea.text = ImageSnapshot.encodeImageAsBase64(ohSnap);
    InsertImage(textArea.text);
    In the HTTP service AS module:
    private  
    function InsertImage(sImageCoded:String):void { var sQry:String;sQry =  
    "INSERT INTO image (lImageId, blbBitMap, txtImage, lRecipeId) " sQry +=
    "VALUES(0, '" +sImageCoded +"', 'text', 23)"  
    //Alert.show(sQry);mysqlQuery(sQry,
    "InsertImage");}
    As mentioned previously, an HTTPrequest error is generated although I can enter
    the string into the blob manually in MySQL.
    Scott

Maybe you are looking for

  • How create and work with Z output to meet user req

    hi gurus, I am SD functional consultant and need ur help Please explain me how create and work with Z output . How we arrange and change the fields in header and footer where and how we do changes in Layouts setting and SAP scripts to meet the user r

  • Need help on content protection

    i can't connect to blackberry apps world because it keep saying that i need to turn off my content protection, and don't know how to do so. can anyone help please??

  • Disk Utility scare - then filesystem repairs itself!

    Yesterday, when my iMac was running badly after the latest Software Update downloads, I ran a Disk Utility check on the hard drive and it refused to run, reporting "Invalid node structure" and "Filesystem verify or repair failed". So I booted to my e

  • Cost to upgrade from pse 5 to pse 13

    Does ANYONE still use this forum.

  • How do I sort bookmarks in Mavericks?

    Getting really frustrated with the new OS! Tried without success to use Safari sort which was mentioned in past discussions. In the old OS, I had "sort alphabetically" at the end of my Safari bookmarks list--it was so easy. For some crazy reason, Mav