Input file location

Hi,
I have a small swing application which is trying to read a txt file. I am getting a FileNotFoundException. The swing app consist of couple of files which are all in the same package. Where should be the txt file located. I dont want to provide an absolute path ( no hard coding)
Thanks

If the *.class files are bundled in a jar file the structure would be /package1/contents1/file.txt
If you're running straight out of JDev then reference the file in relation to where the .class is that trying to read the .txt file.
Post your stack and dir structure if you're still unsure.

Similar Messages

  • How to count Number of Input files onTarget Location?

    Hi Experts,
    I want to identify number of Input files available in Directory of Target system. Input file format is Input*.txt
    Once if I have this Count then based on that I can apply further logic in SAP R/3 coding.
    Please suggest me for the same.
    Regards,

    >
    Jagesh Lakdawala wrote:
    > My requirement is to read the Input Text file available on a given Location.Filename format is Input*.txt because Number of Input file is not fixed. All the Input file data needs to be available at the same time in R/3 coding (Internal table). i.e in a single XML message payload.
    > My question is in this BPM how do i know the LOOP Counter?? because LOOP should run depending on the Number of Input files available with the format Input*.txt.
    >
    > Please suggest.
    >
    > Regards,
    > Jagesh
    so say at one instance there are 7 files and XI picks them up, your BPM collects it and when you send it to R3 you need to know how many files have been processed?
    Well if this is the case, modify your BPM to accommodate collect pattern based on time. So fix a time period basically a time out say an hour. So the BPM will run for an hour after it receives the first file in and if within an hour say 7 files have come in, once the time out kicks in the BPM will exit. In you mapping of N:1 inside the bpm you can write a UDF which will count the occurrance of the root node of the source (a mandatory node of the source) and populate it to any field in the target tht you want to use.
    Is this what you are looking for?

  • In ABAP How to locate an Input file  from a Directory during run time

    I'm loading data from a flat file(text file) into SAP thru BDC programs. All my input files are present in Application server.How to locate an Input file in a directory during run time to process BDC programs programmatically. Are there any in-built functions?Provided me some sample code or any method of doing the same.

    Hello Murali,
    you should ask this question in the ABAP forum.
    Regards
    Gregor

  • C++ debugger can't find input file, regardless of location

    I have an input file that's turned into an ifstream object. When I run the program without debugging, it's found fine. I've put a copy of the file in every single folder within the project directory, starting at the folder that contains the solution file.
    The debugger still can't find it. Help me, please; I feel like I'm going insane.

    I have an input file that's turned into an ifstream object. When I run the program without debugging, it's found fine. I've put a copy of the file in every single folder within the project directory, starting at the folder that contains the solution
    file. The debugger still can't find it. Help me, please; I feel like I'm going insane.
    Hello,
    I will help you move this thread to C++ forum to get help to confirm whether this issue is related to
    using of ifstream .
    You could share the code with us to clarify this issue. If possible, you could share a simple sample which could reproduce this issue.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Need Help-SOA 11g File Adapter unable to delete input file and its crashing

    Hi All
    Please find the details below:
    1. We have created a simple SOA composite to Read file from an input directory, archive the file in an archive directory using Inbound File Adapter Read
    and then use Outbound File Adapter Write to move the file to a output directory.
    2. File Adapter needs to delete the file after successful read/retrieval.
    3. We are using the "Use Trigger File" for invoking the file adapter. This is a new feature in SOA 11g
    4. Also we are using the option of reading the file as an attachment as we are not doing any transformation in the composite
    Issue Details_
    1. When the trigger file is put in the input directory for the first time, the File Adapter reads the file, archives it and moves it to the output directory
    2. However it does not delete the input file from the input directory and raises Fatal Exception mentioned below:
    [*2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]*
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC PostProcessor::
    Delete failed, the operation will be retried for max of [0] times
    [2011-01-12T16:55:48.639+05:30] [soa_server1] [WARNING] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@19c243d]
    [userId: <anonymous>] [ecid: 0000IptyLrL9_aY5TrL6ic1DBOS_000009,0] [APP: soa-infra] File Adapter FileAdapterTriggerFilePOC [[
    BINDING.JCA-11042
    File deletion failed.
    File deletion failed.
    File : C:\Dibya\AttachmentTest\InputDir\TestFile3.txt could not be deleted.
    Delete the file and restart server. Contact oracle support if error is not fixable.
    If any one has faced similar issues, kindly provide pointers on how to resolve it.
    Regards,
    Dibya

    Hi,
    Using the file adapter, you can poll from multilple locations...
    Keep the following property in your .jca file
    <property name="DirectorySeparator" value="," />
    While giving the path in File Adapter configuration, keep comma and give the next location....then the file will be picked up from the locations you gave....
    Hope this helps...
    Thanks,
    N

  • How to execute an SSIS package on a scheduled basis from remote server and pass in input files

    I have an application server and a db server.  My db server has all things SQL Server stored on it (DBMS, SSRS, SSIS, etc.)  I have several nightly batch process SSIS packages (dtsx files currently) that will pickup an input file and import them
    into the database.  I would like to execute all batch processes from my application server as I have quite a few other ones as well that do other stuff outside of SQL Server via powershell.  My question is how to do this?  Is there away to execute
    them remotely via DTexec.exe, should I set them up as Agent jobs and somehow pass in the file names\location (how?), create and SSIS catalog, etc.?  
    I need to easily be able to see if the packages execute successfully or not and if not capture the detailed information of why they failed from the remote server so I can use that to drive my process flow logic in the batch processes.

    Hi Jason,
    According to your description, you want to execute a package on a schedule and receive notification when package ends with error in the job.
    After testing the issue in my environment, we can directly add the package in a step of a job, then add a schedule and set the Alert and Notification property in the job to achieve your requirement. For more details, please see:
    Create a Database Mail in the SSMS.
    Right-click the SQL Server Agent services to Enable mail profile, then select the appropriate Mail profile.
    Under the Operators folder, create an operator with the correct E-mail name.
    Right-click the Jobs folder to add a new job.
    In the Steps pane, New a step with SQL Server Integration Services Package Type to run the package.
    In the Schedules pane, New a schedule for the job.
    In the Alerts pane, New an alert with SQL Server event alert, then enable Notify operators option with an operator in the Response pane.
    In the Notifications pane, enable Email option with same operator and When the job fails selection.
    Then when the package fails, the job would be failed and we can receive the error message in the mailbox.
    Besides, please make sure the account that execute the job has correct permissions for the file, for the folder that contains the file, and for the database.
    References:
    Configure Database Mail – Send Email From SQL Database
    How to setup SQL Server alerts and email operator notifications
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Help needed on Transforming input File to EDI Format

    I have an input flat file in one location. Using BizTalk, i need to pick that file from that Recieve location, transform it to EDI format and send it to Destination location.
    Now, when I place input file in the "Recieve location", it is being processed and it is erased from recieve location. But I am not able to see the output in the Destination location.
    And when i query it in BizTalk Administration console, the state is "Completed" without any errors.
     Any guidance/suggestions are appreciated. Thanks in advance.

    Hi all, I have just collated everything and have put it in my words below..Please
    let me know your valuable inputs as I am struck in this point from more than a week.
    I need to fetch an input flat file (.txt format) from the "Receive location" and I am supposed to transform that to an EDI message X12 format and send it to Destination folder.
    I have set up the receive port and send port configurations in the Admin Console, have created the Trading Partners, agreement and other settings.
    The problem I am facing : Now, when I place input file in the "Receive location", it is being processed and I am able to pick up the file from the input folder
    but I am not able to figure out why the file is not being processed and sent to the destination folder.. (If I query for All In Progress instances, suspended instances or Running instances : I am not getting any results and the below grid is always empty).
    And when i query it in Biz-talk Administration console for Tracked instances, the Receive pipeline component's state is "Completed" without any errors.
    And I am not using any Orchestration in between..
    Thank you all in advance....

  • Input file should be deleted only after the output file is successful.

    Hi Experts,
    Could you pleas solve the below issue.
                           In  a file to file scenario, the input file will be picked from a directory location and after processing output file will be placed in the output directory location specified in the receiver communication channel.
    In the sender communication channel for the scenario mentioned above, if the processing mode is given as delete, the input file will be delete as soon as the file was successfully read by the adapter, but this will not ensure that the file processing is complete and the output file is being created.
    If we have a scenario in such as way that the input file should be deleted from the input folder only if the complete process is successful and the output is generated. how can we achieve this functionality?.
    And one more thing if we got the successful output the output file should be placed in one folder. and the if the output file is having errors it should be placed in other folder.

    Hi,
    In Receiver communication channel I have used the below command in Run Operating System
    .And I have kept the processing mode of sender communication channel as test.
    cmd.exe: /C "del /Leela/test.xml"
    You are running the comman line program configured in the receiver File Adapter,but in command line you mentioned the Sender File Folder , So i guess it's not getting processed.
    Try this:
    Try to run the command line in the Sender File Adapter Side
    "Place this in " --> Run OS Command After Message Processing.
    Hope this would work and get in parrallel with u r requirement.
    regards
    Srini

  • 1 input file to 2 output file mapping. Please help!

    Hi Experts,
      I have a snenario where from one input file I have to generate two output files. My sender and receiver systems are the same since I want to generate the output files in the same location. I am using both the systems same just for testing purpose.
    So in IR I have created
      1. one outbound interface for the input file
      2. two inbound interfaces for the output files
      3. one message mapping containing one input message  
          transformation to two output messages.
      4. one interface mapping containing one input interface
          transformation to two output interfaces.
      In ID I have created
        1. one file sender channel and two receiver channels for two output files with different names.
        2. two receiver agreements
        3. one sender agreement
        4. one interface determination of type "Enhanced".
        5. one receiver determination
      But when I run the scenario given one valid input file  I am getting the error in the sxmb_moni : RuntimeException in Message-Mapping transformation: Cannot produce target element.
    However message mapping and interface mapping works perfectly if I test it in IR with the same input file. 
    Can somebody help me understand what I might be doing wrong?
    Have I done the configuration correctly for 1:N mapping?
    Please help! I will be greatfull to you if you can help me.
    Thanks
    Gopal

    If my input file is like this:
       <ns1:LocationMsg_MT xmlns:ns1="http://www.abc.com/Gopal">
             <Location>
             </Location>
    </ns1:LocationMsg_MT >
    Then my scenario is working.
    But my input file will be like this:
    <LocationMsg_MT>
             <Location>
             </Location>
    <LocationMsg_MT >
    This is giving problem.
    How to handle this kind of file?
    Thanks
    Gopal
    Edited by: gopalkrishna baliga on Mar 14, 2008 3:19 PM

  • Input File Repository Server not running

    When I try to access reports I get the following error
    Server Error in '/v2' Application.
    File Repository Server Input is down.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Runtime.InteropServices.COMException: File Repository Server Input is down.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
    Stack Trace:
    [COMException (0x80004005): File Repository Server Input is down.]
       CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +77
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +218
    [Exception: Load report failed.]
       CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +272
       CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +875
       CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +52
       CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(InfoObject infoObject, EnterpriseSession enterpriseSession) +87
       ProjectVillage.ReportView.ViewReport()
       ProjectVillage.ReportView.Page_Load(Object sender, EventArgs e)
       System.Web.UI.Control.OnLoad(EventArgs e) +67
       System.Web.UI.Control.LoadRecursive() +35
       System.Web.UI.Page.ProcessRequestMain() +750
    I have gone to the Central Configuration Manger and it all of the servers running except for input file repository server and output file repository server. When I start those two servers it goes right back to stopped. Now I checked the event viewer for errors and these to errors show up.
    Event Type:     Error
    Event Source:     BusinessObjects_inputfileserver
    Event Category:     Startup
    Event ID:     35602
    Date:          4/8/2011
    Time:          10:04:59 AM
    User:          N/A
    Computer:     PVWEB3
    Description:
    Fail to register with the nameserver.  Please check for name duplication and validness of name used: Input.PVWEB3
    and
    Event Type:     Error
    Event Source:     BusinessObjects_inputfileserver
    Event Category:     Services
    Event ID:     34200
    Date:          4/8/2011
    Time:          10:04:59 AM
    User:          N/A
    Computer:     PVWEB3
    Description:
    Failed to register with the name server. Reason: The server name being registered is invalid. There might be another server registered using the same name. Choose another name or delete the corresponding server entry in the CMC.
    Now to give a bit of a back story as to what happened before this. We were having a issue logging into the domain on this machine. The only way to get passed this was to unjoin and rejoin it to the domain then this happened.  When I try to go to the CMC using the admin launch page I get the following error.
    Server Error in '/businessobjects/Enterprise115/WebTools' Application.
    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
    Requested Url: /businessobjects/enterprise115/WebTools/relativeredirect.aspx
    I'm a bit new to business objects software as this system was setup way before I started working for this company and noone that put this system in place has worked here for a while now. So I'm hoping some of you can help me out a bit or atleast point me in the right direction.

    Disregard that last post. I have gotten into Central Management Console.  My next question is, where in the CMC do I got to fix the following 2 errors I was getting?  I figure that are both talking about the samething but since this is my first time I've been in the CMC I am not sure where to go to fix it.
    Event Type:     Error
    Event Source:     BusinessObjects_inputfileserver
    Event Category:     Startup
    Event ID:     35602
    Date:      4/8/2011
    Time:      10:04:59 AM
    User:      N/A
    Computer:     PVWEB3
    Description:
    Fail to register with the nameserver. Please check for name duplication and validness of name used: Input.PVWEB3
    and
    Event Type:     Error
    Event Source:     BusinessObjects_inputfileserver
    Event Category:     Services
    Event ID:     34200
    Date:      4/8/2011
    Time:      10:04:59 AM
    User:      N/A
    Computer:     PVWEB3
    Description:
    Failed to register with the name server. Reason: The server name being registered is invalid. There might be another server registered using the same name. Choose another name or delete the corresponding server entry in the CMC.

  • Loading a table from multiple input files using sqlldr

    Hi,
    For my project i need to load into a table by joining two input files using sqlldr. For example,
    I have a file1, which has values
    name,salary,ssn
    and file2 which has values for
    ssn,location,country
    now i need to load these values into a table say employee_information by joining both input files. both input files can be joined using ssn as common field.
    Any idea how to do this??
    Thanks in advance
    Satya.

    Hi,
    What is the size of the files. If possible mail me the sample files, And the structure of table. Is the <ssn> from first file and second will have seperate columns in the table or we have to merge it.
    SKM

  • Get Current File Location in ADOBE form

    Hi All
    I need to get the location and file name of current file upon http submit in the form.
    How can we get current file location in abobe form.
    I am trying to use JavaScript var path = window.location.pathname;
    Also tried app.activeDocument.path property. But this does not work either.
    Any inputs will be really helpful
    Thanks
    Kaushal

    Hi Suhail,
    You can query the runtime on this, and these are some examples on how to get this:
    You will need to find the correct location:
    select location_name
    from all_rt_locations
    where location_type = 'File System'
    You will also need the path:
    select PARAMETER_VALUE from ALL_RT_LOCATION_PARAMETERS
    where location_name = 'SRC_FILES_LOC'
    and PARAMETER_NAME = 'RootPath'
    Do NOTE that the location type and RootPath things are case sensitive.
    For the file name..., I think you will have to dig around in the mapping. I don't have an exact example but this is in the direction you will need to be looking if you want to select this from the repository:
    -- This script selects all mappings, its operators and the binding to the repository objects
    -- You can use this to assess the impact of a change to a repository object to your mappings
    -- The script will ask for a parameter specifying the project name. Note that this is case sensitive
    set pages 999
    col PROJECT format a20
    col MODULE format a20
    col MAPPING format a25
    col OPERATOR format a20
    col OP_TYPE format a15
    col REP_OBJECT format a30
    select mod.project_name PROJECT
    , map.information_system_name MODULE
    , map.map_name MAPPING
    , cmp.map_component_name OPERATOR
    , cmp.operator_type OP_TYPE
    , nvl(cmp.data_entity_name
    , '-- No Value --'
    ) REP_OBJECT
    from all_iv_xform_maps map
    , all_iv_modules mod
    , all_iv_xform_map_components cmp
    where mod.information_system_id = map.information_system_id
    and map.map_id = cmp.map_id
    and mod.project_name = '&Project'
    order by 1,2,3,4
    Hope that this is something that you can take and solve your problem with...
    JP

  • Input File Question

    Hi, all!
    I have an input file (InputFileA) that is sent to me from a third party.  I have to load the file into a Table (TableA) and also include, with each row that is loaded, the name of the file from which it came.
    EXAMPLE:
    InputFileA looks like this:
    Number  Amount
    000001  1200.00
    000002  2400.00
    TableA (columns: NUMBER, AMOUNT, FILENAME) should have the following inserts done:
    NUMBER: 000001
    AMOUNT: 1200.00
    FILENAME: InputFileA
    NUMBER: 000002
    AMOUNT: 2400.00
    FILENAME: InputFileA
    Can anyone offer any advice as to how I can extract the filename and then insert it into the Table for each row that is inserted from InputFileA?
    I'm new to SQL Server (originally a DB2 guy) and I don't have much of a programming background, so I'm kind of stuck on this one.
    Thanks in advance and hi to everyone!
    Don

    Assuming you're using SSIS for transfer you can set it up as below
    1. Add a ForEachLoop with file enumerator pointing to file location. Use a variable inside to fetch filename of files found (@[User::FileName]).
    2. Add a data flow task inside loop with flat file source pointing to your file and set an expression for connection string to point to your dynamic file. For this select connection manager,  right click and select properties. Expand expression and
    set an expression for connectionstring property to  point to @[User::FileName] variable.
    3. Add a derived column task, add expression as @[User::FileName] and choose add as a new column option and give it name FILENAME
    4. Add OLEDB Destination to point to your table and map columns from source file to table columns and FILENAME column created above to FILENAME column of the table
    Execute it and you'll get your desired output.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • File location

    I've a file located at c:\java\config\help.txt
    I'm using File input stream to read that file. I'm the running my class from c:\java\test\. The file location is hardcoded in the source as c:\java\config\help.txt
    Is that a way that I could define simply cofig/help.txt rather then entire path. So in theory if I want to run my class in unix machines it would still work?
    Thanks
    Tim

    Demo:
    import java.io.*;
    import java.net.*;
    public class Test {
        public static void main(String[] args) throws IOException {
            URL url = Test.class.getResource("/");  //url of dir holding this class
            URL url2 = new URL(url, "../config/help.txt");
            InputStream in = url2.openStream();
            BufferedReader r = new BufferedReader(new InputStreamReader(in));
            String s;
            while ((s = r.readLine()) != null)
                System.out.println(s);
    }I'm assuming that Test.class is in a dir that's a sibling to dir config (ie, these
    two dirs are in the same parent dir). I had a bit of trouble going "up and over" to config,
    hence the URL monkey business. Is there a cleaner solution, anyone?

  • How to make SSIS packages automatically read the input file from a path?

    Currently I am using a SSIS package to read data from a .dat file and load it into SQL Server tables.
    I am placing the input .dat file on the desktop. In the connection manager -> Browse option, I am pointing this file to create connection.
    The file naming convention is like - aSNAP_Data_20140926_P-2014-09-26_07.02.36
    However, I need the SSIS package to automatically read the input file from a folder which is located in a remote server. This folder has lots of files where input files are added on a daily basis with the date value in the file name as mentioned above.
    I want to schedule the SSIS package to run daily and take the latest file in the folder based on the date.
    Please let me know how to do it. Any help would be highly appreciated.....
    Thanks in advance.

    Hi SQL_SSIS_Dev,
    According to your description, you want to get the latest file from a path to a SQL Server table. After testing the issue in my environment, we can refer to the following steps to achieve your requirement:
    Create two variables, VarFolderPath stores the folder path in which our files exist, VarFileName hold the value of most recent File Name.
    Drag a Script Task from SSIS Toolbox to Control Flow Pane, then select “User::VarFolderPath” as ReadOnlyVariables, select “User::VarFileName” as ReadWriteVariables.
    Then Edit Script with the C# code below:
    Add “using System.IO;” into namespace.
    Add the code below under Main function:
    var directory= new DirectoryInfo(Dts.Variables["User::VarFolderPath"].Value.ToString());
                FileInfo[] files = directory.GetFiles();
                DateTime lastModified = DateTime.MinValue;
                foreach (FileInfo file in files)
                    if (file.LastWriteTime > lastModified)
                        lastModified = file.LastWriteTime;
                        Dts.Variables["User::VarFileName"].Value = file.ToString();
    Drag a Data Flow Task to Control Flow Pane and connect to Script Task.
    In the Data Flow Task, drag a Flat File Source with a file in the source folder as all the files have same structure as the File name.
    Add the property below the Flat File Connection Manger expression:
    Property: ConnectionString      Expression: @[User::VarFolderPath] +"\\"+ @[User::VarFileName]
    Drag an OLE DB Destination that connect to the Flat File Source, then configure a table to store the data.
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Even though my email accounts seem to be set up when i press the email icon it just lists icloud, EOL etc and asks for new account to be set up

    Even though my email accounts seem to be set up when i press the email icon it comes up with Icloud, EOL etc like it is not set up.  When you press on icloud and put in details it says the account is already set up. Email had been set up and receivin

  • What's data Clusters? Plese see...

    Hello all, What is the meaning of this::: The PCLn database tables are used to store data clusters (such as results from Time Management, Travel Management, and Payroll) What are data clusters and is there any documentation on it? Any special way to

  • Interactive document exported as swf navigation problems

    I created an interactive document, exported as a swf file. Each page has an animation build, text fade in, images slide in etc. When I navigate to the next page, it displays the completed build, reloads and plays the animated build. When I navigate t

  • Hey There, Wee Problem Calling Methods!

    Hey theree, i have designed auser interface that will eventually do a number of functions. The code below shows this import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.swing.*; import java.io.File; * ImageViewer is the

  • Warehouse wise Profit Center

    Dear Experts, Consider the following scenario. The client has one plant and three warehouses. He manufactures as well as imports the FG. All the deliveries are done from either of the three warehouses. But while doing the sales order he doesn't know