How to read file on another pc

my application has a pc as a server and it contains files which have to be read from another ( client) pc within the lan.how do i write java code for this and what abt the formatting of file type ie itmay be pdf, html etc.

Are you talking about a web application?
what abt the formatting of file type ie itmay be pdf,
html etc.You need to decide the type of file you would be reading. Reading a HTML file is not the same as reading a PDF.

Similar Messages

  • How to open Adobe Reader file from another native IOS application?

    There is an existing thread, but I want to re-open it because I think this is an important feature that we need badly.  I was wondering if there is any plan to add this feature so we can open PDFs directly into Adobe from the web / other apps.
    How to open Adobe Reader file from another native IOS application?
    Basically, we just want to use a custom URL scheme to open a specific document in the App.  Currently, this only opens the app but does not load the file.
    APB

    Not to hijack the conversation but I can explain why this would be useful for both the above case and another.
    What I believe Pavel is talking about is setting up a "URL Scheme" for the Adobe Acrobat iOS application so that you can easily open a PDF specifically in Adobe Acrobat iOS from other native applications and even from web applications opened within Safari. This is particularly useful if your application requires some of the specific features in Adobe Reader iOS to grant them the best experience possible and you want to encourage this.
    Another case: If you're using Adobe Livecycle's document security modules (that encrypts PDF files so that Adobe Acrobat must "phone home" to decrypt and view the document), these PDF's can only be viewed inside the Adobe Acrobat application and appear as blank in most other PDF readers. Having a URL scheme allows your application utilising this functionality to have a 1 click step to view the PDF rather than the current non-user friendly process:
    - Within Safari, touch the PDF link (appears as blank in the default Safari PDF reader, which in itself is confusing)
      - Touch "Open in..."
      - Touch "Adobe Acrobat"
    We have an immediate need for this functionality for the example above. I can resubmit it in a separate post if necessary.

  • How to copy file to another server from database using FTP in oracle

    How to copy file to another server from database using FTP in oracle.
    Please do the needfaul.

    Billy  Verreynne  wrote:
    BluShadow wrote:
    Not to mention that some FTP servers can return more than one return message per operation whereas others may return one message for the same operation.I had the problem using the LIST command to determine if a file exists on the server. Cannot be determined via the FTP server's return code. Which means parsing and checking the text response from the server to the command. And this vary from server to server.
    But the basics were quite easy to code. The entire package is 500 lines, includes comments and blank lines for formatting, and supports the basic FTP client command set. Not really a complex piece of software to write - but I found that many developers seem to think that writing network socket software is complex. Not really the case...Mine's a big larger, but incorporates functionality similar to what Chris provided in his, such as being able to use SQL to query a remote file using pipelined functions, or functionality to write the results of a query directly to a remove file.
    :)

  • [Urgent] How to read files from different directories?

    I am new to Java Programming, I would like to know how to read files from directories other than the current one? (example as follows)
    ProjectDirectory
    |--MainDirectory
    |--MainProgram.java
    |--SupplementDirectory
    |--SupplementProgram.java
    |--Pictures
    |--Image.gif
    What should I write in the MainProgram.java so that I can use the supplementProgram.java from MainProgram and read the Image.gif file from the MainProgram.java?
    Thanks

    Run through the I/O tutorial here. It should get you up to speed on this sort of thing...

  • How to read files in whole directory

    hi everybosy i have got a directory called grepdatabase in the following path
    /users/zer/gd.
    it has 3000 files in it.i have to read each file and do soem process and write it into another file.
    but with the following code it says, directorydoesnot exists.but i have the directory,with all the files in it.
    File database = new File("c:/Domain/nbi.bbsrc.ac.uk/Users/zer/gd");
            if (database.exists() && database.isDirectory()) {
                String datafiles[] = database.list();
                for (int i = 0; i < datafiles.length; i++) {
                    System.out.println("processing file: " + database.getAbsolutePath() +
                            "/" + datafiles[0]);
            } else {
                System.out.println("Database exists: "+database.exists()+"\nDatabase is Directory: "+database.isDirectory());
            }can anyone help me how to read multiple files...

    ur code can be little modified as follows to make it work flawlessly
           File database = new File("c:/Domain/nbi.bbsrc.ac.uk/Users/zer/gd");
                  if (database.exists() && database.isDirectory()) {
                      //String datafiles[] = database.list();
                      //Instead use file list here
                      File[] datafiles = database.listFiles();
                      for (int i = 0; i < datafiles.length; i++) {
                      //    System.out.println("processing file: " + database.getAbsolutePath() +
                      //            "/" + datafiles[0]);
                       System.out.println("processing file: " + datafiles.getName());
    } else {
    System.out.println("Database exists: "+database.exists()+"\nDatabase is Directory: "+database.isDirectory());
    BR

  • How to archive files in another ftp server?

    Hi,gurus:
       My scenario is file to file and my sender adapter is ftp adapter.
       Now I want to archive the send file in another ftp server,how can I  implement it?
       There is a parameter "Archive files on FTP server" when I choose the processing mode "archive".What's  it's use?Thanks in advance.

    Hi,Santhosh:
      Thanks for your reply.
      I have checked your blog before,and it is very useful for me.
      I still have a problem about command line.
      In an sap note,I found the principle of the execution of the command line is like below code:
    import java.util.*;
    import java.io.*;
    public class test {
    public static void main(String args[]) {
    try {
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("C:/data/test.bat <param1> <param2>");
    } catch (Exception e) {
    e.printStackTrace();
    But you know this method has restriction.If my bat file has many commands,it only execute a part of commands(sometimes 8,sometimes 9 ).
    My bat file is like below:
    echo open 192.168.67.149 >c:
    data
    copyResult.txt
    echo <username> >>c:
    data
    copyResult.txt
    echo <password> >>c:
    data
    copyResult.txt
    echo cd /receive>>c:
    data
    copyResult.txt
    echo get %2>>c:
    data
    copyResult.txt
    echo cd /ok>>c:
    data
    copyResult.txt
    echo put %2>>c:
    data
    copyResult.txt
    echo cd /archive>>c:
    data
    copyResult.txt
    echo delete send.txt>>c:
    data
    copyResult.txt
    echo quit >>c:
    data
    copyResult.txt
    ftp -s:c:
    data
    copyResult.txt
    del %2
    I wanna merge all the "echo" in one command,so it may execute successfully,but I don't know the method.Any ideas?

  • How to read files in java

    Hi
    I have a directory that has files put into it. What I want to do is open/read these files in java and then do something to it and then move the file to another folder called passed or failed.
    What I dont know is how can I read a file who's name i dont know of?
    Example I know the directory the files will go into
    c:\test\csv\
    but the file name i dont know of they could be called anything and have any extension!
    My program will loop every 10 minutes and check if there are files in the directory. If so it will process them. Once files have been processed their should be no more files left in this directory.
    Kind Regards
    Antek

    Hi
    Thanks for your answer it pointed me in the right direction. I now have small problem. If i do directory list like the code below it gives me all the files but it also gives me any directories in the folder. How can i tell it to give me files only and no folders.
    Many thanks
    import java.io.*;
    import java.util.*;
    public class SimpleDirList
         public static void main(String [] args) {
              String directoryName;
    File directory ;
    String[] files;
              directory = new File("c:\\java_code");
              if (directory.isDirectory() == false) {
                   if (directory.exists() == false) {
                        System.out.println("There is no such directory!");
                   } else {
                        System.out.println("That file is not a directory.");
              } else {
                   files = directory.list();
                   System.out.println("Files in directory \"" + directory + "\":");
                   for (int i = 0; i < files.length; i++) {
                        //do something
                        System.out.println(" " + files);

  • How to read file on demand (or) avoid polling in bpel 11g?

    Hello -
    Scenario - Receive two files(A & B) which should end up in two tables (Header, Lines)
    BPEL process -
    1) Receive acitivity - To Read file (A) via File adapter
    2) Tranformed
    3) Invoked the Db adapter to insert into "Header" table
    4) Added another Receive activity - To Read file (B) via File adapter
    5) Transformed
    6) Invoked the Db adapter to insert into "Line" table
    Issue - Step 4 gets fired as a SEPARATE instance (but no data in lines table) . At the end - I see the BPEL process which is waiting for File B. Even after I dropped File B - I dont see any records going into tables.
    Is there a better way to design this process? Do I need to separate BPEL process to insert into Header & Line table? If so - how can I make this sequential process?
    Appreciate detailed steps, if possible
    Thanks
    Babu

    If its really a SyncRead Step 4 willl not run as a seperate process.
    Step1: Initiates the process once the header file arrived
    Step4: Will be invoked like a normal partnerlink.
    Just make sure, you put the lines file before the header file in the directory.
    If it doesnot resolve the problem, send your project to me helloprasanna at rediffmail.com . I'll have a look.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to read stdio of another program

    Hi,
    I have a program that reads data from PC serial port and prints that into the command prompt (stdio) in text format.
    The idea has been that the output is redirected to a file and then the file is analysed off-line with Excel or Matlab.
    Now I would like to make a front-end program with LabWindows that shows the data graphically in real-time.
    I don't want to change the original program that reads the port and prints the data to command prompt as it is needed as such also in the future.
    The question is how to read the stdio of another program in real-time with LabWindows?
    I have tried LaunchExecutable() to start the other program from LabWindows but cannot get hold of the data printed on the command prompt.
    There are examples of DDE-solutions for two programs to exchange data but this seems an overkill for my problem as there is only one-directional data that I want to read into the Labwindows program.
    I thought that it would be quite common to implement such a graphical front-end to display real-time graphics of some old text-based program. Amazing that there seems not to be good and easy solutions for LabWindows.
    (I did implement a quick solution with Qt but LabWindows would offer much better graphical elements for drawing the measurement data.)
    Thanks!

    Hi,
    Thank you for the link.
    I implemented those short programs in LabWindows and tried them. Yes, works perfectly!
    Write-program's output is redirected to a file with ">" and the Read-program can read the file even if the programs are running simultaneously.
    The bad news is that this does not work with the program that I need to use.
    There is a small difference in the behavior of the programs that write output to the command-promt. I don't understand why.
    1) The small Write-program implemented from the link opens a new command-prompt where the output goes if there is no redirection. And if there is the redirection ">" it still opens the new command-prompt but it stays empty as the ouput goes to the file. (And the Read-program can read the file; everything works okay.)
    2) The program that I need to use does not open a new command-prompt when started; it's output goes to the same command-prompt where it is started from. With redirection the output goes to the file; no new command-prompt this time either. But the problem is that the reading program cannot read the file. The Read-program can read the file if it has been created and written before. But not if it tries to read it at the same time that it is written by the other program.
    Maybe this is a simple problem if you know how to solve it... :-/

  • How to read file from remote machine

    Hello,
    Hi, i would like to know how to read text file from remote machine using java source code, any code ?
    Thanks very much;
    Best regards
    Kim

    On the server, perform the following steps:
    Parse the request and determine the file to serve
    Open a FileInputStream to the appropriate file
    Obtain a reference to the Servlet OutputStream
    Pipe the bytes from the file to the output stream
    Flush and close the streamYou might want to call HttpServletResponse.setContentType("application/octet") to indicate to the browser that a file download will be occurring. Do so before getting the reference to the Servlet's OutputStream.
    - Saish

  • How to read file from server if I have a logical file path?

    Hi guys,
    I'm having a pretty "on the run" question,
    My program is currently reading a file from server using "open dataset" with file path like this (just example)
    /usr/interface/abc/bcd/testfile.dat
    Now I got a requirement to make it more consistent to read files, instead of reading that physical file name, I should read the files from a specific folder using logical path.
    So I go to T code "FILE" and created a logical path called ZABC_FILE_PATH, unix compatible, with physical path is (for example),
    /usr/interface/<sysid>/<client>/<filename>
    My question is, can I still use open dataset statement to read this? if yes, how do I do that? If no, there should be alternative way, please let me know what you think. Thanks,

    Thanks all, I figured it out.
    ONe thing is that typo double quote
    The other thing is the importing part, I need the full file path.
    CALL FUNCTION 'FILE_GET_NAME_USING_PATH'
      EXPORTING
        CLIENT                           = SY-MANDT
        logical_path                     = 'ZABC_MY_LOGICAL_FILE_PATH'
    *   OPERATING_SYSTEM                 = SY-OPSYS
    *   PARAMETER_1                      = ' '
    *   PARAMETER_2                      = ' '
    *   PARAMETER_3                      = ' '
    *   USE_BUFFER                       = ' '
        file_name                        =  v_1
    *   USE_PRESENTATION_SERVER          = ' '
    *   ELEMINATE_BLANKS                 = 'X'
      IMPORTING
        FILE_NAME_WITH_PATH              = v_what_I_need
    * EXCEPTIONS
    *   PATH_NOT_FOUND                   = 1
    *   MISSING_PARAMETER                = 2
    *   OPERATING_SYSTEM_NOT_FOUND       = 3
    *   FILE_SYSTEM_NOT_FOUND            = 4
    *   OTHERS                           = 5
    I really appreciate your contributions, thanks again!

  • How to read file header/open filein binary mode

    i am using FileConnenction API to read from a file. how can i open a file in binary mode so that i can read file header. In other words i want to open a file in binary mode.

    You can always try looking at the [Header Signatures|http://www.techpathways.com/uploads/headersig.txt]. But it would probably be easier to adjust your application so it doesn't have to guess.
    ~

  • How to read files....plzzz

    Hi! All,
    I have a problem in reading files using jfilechooser class.
    when i select open menuitem from the file menu and reading it through
    the file reader class it is giving nullpointer exception.
    Also i tried by hardcoding filename in filereader class instead of using getSelectedfile().This time it is not giving null pointer exception but it is showing any stuff.
    Here's the code i am using...
    int returnVal = fc.showOpenDialog(openpanel);
    if(returnVal == JFileChooser.APPROVE_OPTION){
    file = fc.getSelectedFile();
                   //This is where a real application would open the file.
    if(fc == null)
         file = new File("D:\\karthik\\java\\");
         file = new File("D:\\karthik\\java\\kar.txt");
         fc.setCurrentDirectory(file);
    BufferedReader infile = new BufferedReader(new FileReader(file));
         files.append(infile.readline()); //files is the textarea..

    how come you do a fc.setCurrentDirectory(file);?
    where exactly do you get the NullPointerException? what does your stacktrace say?
    thomas

  • HOW to read file using ftp???

    Hi to all,
    I have problem with reading file using ftp connection, i want to read only 1024 bytes for one time, and i have
    next code wich read this:
    byte buffer[] = new byte[1024];
    while( (readCount = input.read(buffer)) > 0) {
    bos.write(buffer, 0, readCount);
    but I dont know how to put all read data in one byte[] if i dont know length of file.
    I can't do some like: byte file[] = new file[1000000];
    Thanks for all sugestions!

          * Download a file from a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
          * @param ftpServer FTP server address (incl. optional port ':portNumber').
          * @param user Optional user name to login.
          * @param pwd Optional password for <i>user</i>.
          * @param fileName Name of file to download (with optional preceeding relative path, e.g. one/two/three.txt).
          * @param destination Destination file to save.
         * @throws MalformedURLException, IOException on error.
         public void download(String ftpServer, String user, String pwd, String fileName, File destination) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && destination != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bis = new BufferedInputStream(urlc.getInputStream());
                    bos = new BufferedOutputStream(new FileOutputStream(destination.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//download()If you don't want to strore the data into a file, use ByteArrayOutputStream instead of a FileOutputStream.

  • How to Read file name which we are dealing with ODI File tool

    Hi,
    We are using ODi10g version and we have requirement to move file from one place to another place. We are using ODIFileMove utility but we also want to read file name.
    Any help.
    Thanks in Advance.

    You can accomplish this with a fairly simple Jython script.  Use the os.listdir(<directory>) command to get the name of files in a given directory. 
    You can then (still in the Jython script) loop through the files and move them to a desired location (bypassing the OdiFileMove tool) OR use the Jython script to write the file names to a SQL table.  Then, use an ODI procedure to loop through the newly inserted records and store the file name in an ODI variable that you can then use in your OdiFileMove tool etc.
    I often refer to this blog entry from Gurcan Orhan as a starting point for this kind of task: Loading multiple files with ODI | Gurcan Orhan&amp;#039;s Oracle Data Integrator Blog

Maybe you are looking for

  • Help please. Restore problem~!

    Hey I have the original Ipod Nano 2GB. And it was working fine then all of a sudden one day it asks me in three different languages to restore it. So I plug it in and try to restore it. It restores then when the 15 seconds are up it just goes back to

  • "Import from Text File" & "Upload from Clipboard" icon not appearng in F110

    Hi Experts, While making the payment to the vendors through TN F110, in "PARAMETER" screen just next to 'STATUS' screen, there is a vendor field for selection in range and just ahead of this there is an icon for multiple vendor selection ( Bold arrow

  • Fields terminated by (SQL loader, external table) question?

    Hello. I have a txt file which looks like: Columns: A..........B.........C...........D.........E..............F.............G...........H 739.......P.........0002......05........25012006..25012006..5...........data group . = space There are different

  • Disableing nodes in JTree

    Hi All, is it possible to disable the nodes in a JTree. i.e. Grey them out, so user is not able to select. thanks

  • Can i read a book using windows 7

    can i read a book using windows 7