Reading a file through a telnet socket

Hi,
I would like to be able to read the contents of a file once
I've logged on to the server. I have logged in successfully.
If I use
BufferedReader isr = new BufferedReader(new FileReader("path/code.txt"));
I get an IOException saying it can't find the file.
Am I supposed to use the socket (socket.getInputStream()) with a reader class to indicate that the file I want to read is through the socket and not on my desktop? If so how do I do it?
TIA
Lynda

You have to get the server process to open the file on the server machine and have it pass the file back through the socket. Just creating a socket from your client machine to a server machine is not in itself enough to see the file system.
For example FTP works like this (at a conceptual level)
server: listening on port 21
client: connect to server on port 21& supply username password
server: username OK
client: GET me file called code.txt
server: open file code.txt on local file system, pass the bytes through the socket
client: read the bytes coming through the sockets and place them in a file called code.txt on the local FS
client: terminate connection
hopefully this will point you in the right direction

Similar Messages

  • Steps to read a file through file adaptor and then i need that to insertDB

    Hi anyone please help me in reading a file through jdev and then insert into data base i am able to receive the file the null values and getting inserted..
    thanks
    saileshan.

    Hi,
    Please let us know the following -
    1) Did you verify that you are able to see all the data in the BPEL process from the File which is read?
    2) Are you using a transform or an assign activity to insert data into table?
    If using a transform activity, did you test the mapping file (.xslt) and see that the transformations are happening correctly?
    Let us know the answers to the above questions before we proceed further.
    Thanks,
    Ritika

  • Reading foxpro file through jdbc

    i want to read foxpro file through jdbc.
    whether there is a jdbc driver or a odbc one for this purpose.
    Please if possible provide me the links which will solve my purpose.
    thanks in advance.

    HXTT DBF is available at http://www.hxtt.net/dbf.html .
    Yonghong Zhao
    System Analyst
    www.hxtt.net

  • Problem while reading multiple files through FTP Adapter

    Hi,
    We have a requirement to read the excel files placed in an FTP Location and as there is no Adapter to read Excel file
    we are using FTP Adapter and reading the Header values of the file(name of the
    file) and we are paasing as input to the Java code which will read the data nd insert into the Database.
    If we place above 20 files it was reading only some files and some were left and if we delete the files and place the unread files again some files are read and if we do the same procedure then all the files were read.
    Any help regaring this appreciated.
    Thanks and Regards,
    Nagaraju .D

    Are you doing anything complex for your polling, e.g. Files that must be n time old.
    Can you post the WSDL so I can see the polling configuration. I only need to see the adapter configuration, not the whole file.
    cheers
    James

  • I can't read pdf files through Safari.

    Just recently I cannot read pdf files from Safari.  The file shows up as dark space.  I don't know why?  Guessing I changed something that caused it.  Any ideas?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have "Adobe" or “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Cannot read Excel file through ADODB in SCCM 2012 R2 WinPE

    Hi,
    I'm trying to read an excel file from WinPE 5, and get this error :"Provider cannot be found. It may not be properly installed.". My code is (Vbscript, in a HTA) :
    Dim cn
    Set cn = CreateObject("ADODB.Connection")
    With cn
      .Provider = "Microsoft.Jet.OLEDB.4.0"
      .ConnectionString = "Data Source=" & Fic_ref_deploy & ";Extended Properties=Excel 8.0;HDR=Yes;IMEX=1;"
      .Open
    End With
    I've included many packages from SCCM  : WinPE-DismCmdlets ; WinPE-Dot3Svc ; WinPE-HTA ; WinPE-MDAC ; WinPE-NetFx ; WinPE-PowerShell.
    Have I missed something ? May I add something else ?
    Thanks,
    Fabrice

    Hello Fabrice,
    According to this
    link, for issues regarding Native data access components (ADO, Sql Native Client, MDAC, ODBC, OLEDB, JDBC, Sql Server Soap/Http), it is suggested to post to:
    http://social.technet.microsoft.com/Forums/sqlserver/en-US/home?forum=sqldataaccess
    The current forum is used for Data platform development using ADO.NET managed providers, especially System.Data.SqlClient, System.Data.Odbc and System.Data.Oledb.
    Regards.
    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.

  • Reading PDF file through BPEL file Adapter

    Hi,
    We have a requirement where in we have to read PDF document. We have to use the data coming from the PDF.
    We checked "Native format not req" check box in File Adapter and could get the PDF data in some other format but are not able to read required data from it.
    Help in this regard is highly appreciated.
    Regards,
    Manasa.

    File adapter at present does not help in reading pdf data.
    to do this, you might wanna have a java program interface between your pdf and bpel.
    Message was edited by:
    AshishSharma

  • Please Help ! How would i Read xml file through servlet

    My requirement is that i have to make a stock exchange streamer.
    i am making an applet to show real time data to client. i had succeded in applet-servlet communication, but i m getting problem in
    parsing the xml files inside a servlet and throw it to applet again.

    I would suggest that you find out what the problem is, then. Once you find that out you will be far ahead of anybody else reading this post, because they have absolutely no idea what your problem is.

  • Reading Writing File Through JApplets on Client

    JApplet gives security Exception when reading or writing any file on client.
    The Java Policy is also changed and set to all permissions.
    Kindly Help.

    sign your applet

  • How to read .xml file from embedded .swf(flash output) in captivate

    I have been trying to read .xml file from the .swf (Flash output) that is embedded within the captivate file but no luck yet . Please if anyone got any clue on how get this thing done using Action script 3.0 then let me know. I am using Adobe Captivate 5.5 at present and Flash CS 5.5.
    I am well aware about how to read .xml file through action script 3.0 in flash but when insert the same flash in captivate and publish nothing comes in captivate output. I would higly appreciate if anyone could help me out with that.
    Here is is graphical demonstration of my query :
    Message was edited by: captainmkv

    Hi Captainmkv,
    Does the information in this post cover what you're trying to do: http://forums.adobe.com/message/5081928#5081928
    Tristan,

  • Is it possible to read "rtx" files in JAVA.. and make a "xls" files.. !!

    Hello frnds..
    I dont have any idea.. how to read rtx files.. in JAVA.. ??
    I have some data in rtx files.. which i want to read it.. and save in xls files.. !!
    Please someone help.. am new to java.. searched a lot.. abt that .. but didnt find.. anything.. !!
    gervini

    I'm not being dismissive but I think your question comes down to "is there already a package/library to do this".
    You can use POI/HSSF to generate xls using Java. As for the other end, is rtx a rich text format? Are you able to parse the information in the file by simply reading the file through the regular file reading mechanisms?

  • Reading mdb files

    Is there any utility to read mdb files through java. I need to read the standalone mdb files as there is not database running. I am aware of jackcess, any other info will be helpful.

    Try with this tool that is useful for reading of a Database through SQL
    Good Luck
    http://jeffreytravis.com/lost/labsql.html
    Antonio Garcia Olais

  • Transfering a file through Socket programming

    Hi all,
    I want to return a file from server to client through a socket. I tried using ObjectOutput Stream where in I returned a java.io.File from server. But at client side when I say file.getLeangth() it comes as 0 and if I try to assign FileInputStream on the object it throws an exception as the file not found as the path associated with the file will be of Server.
    So can anyone help as to how to transfer a file through socket programming???
    thx in advance
    MK

    java.io.File is NOT the contents of the file. It really just represents the path.
    If you want to transfer the file's contents, you'll have to use a FileInputStream or FileReader, read from it, and then write the bytes or chars on the wire.

  • Sockets: can only send once file through

    Hi,
    I am using sockets to send text and files to a client on a Clio. I want to send multiple files through. However, only the first file goes through. The rest are never received (although they are uploaded). My question is:
    Why can not send anything through the socket (text or files) after the first file is sent?
    The fileSend() is on the server side, fileReceive is on the client side.
    public static void fileSend (Socket uploadSocket, String source) {
         try {
             InputStream inFile = new FileInputStream(source);
             InputStream in = new BufferedInputStream(inFile);
             OutputStream out = new BufferedOutputStream(uploadSocket.getOutputStream());
             System.out.println("Sending " + source + ".");
             int data;
             int bytes = 0;
             while ((data = in.read()) != -1) {
              bytes++;
              out.write(data);
             bytes++;
             out.write(data);
             if (in != null) in.close();
             if (out != null) out.flush();
             System.out.println("Upload complete: " + bytes + " Bytes!");
         catch (Exception e) {
             System.err.println("Couldn't upload " + source + ": " + e.getMessage());
       public static void fileReceive (Socket downloadSocket, String destination) {
         try {
             InputStream in = new BufferedInputStream(downloadSocket.getInputStream());
             OutputStream outFile = new FileOutputStream(destination);
             OutputStream out = new BufferedOutputStream(outFile);
             System.out.println("Downloading data to " + destination + ".");
             int data = in.read();
             int bytes = 0;
             while (data != -1) {
              bytes++;
              out.write(data);
              data = in.read();
             bytes++;
             if (out != null) {
              out.flush();
              out.close();
             outFile.close();
             System.out.println("Download complete: " + bytes + " Bytes!");
             in.skip(in.available());
         catch (Exception e) {
             System.err.println("Couldn't download " + destination + ": " + e.getMessage());
        }Thanks,
    Neetin

    I think its better to pass the outputstream to the filesend() method and inputstream to fileReceive() method
    something like this:
    OutputStream out = new BufferedOutputStream(uploadSocket.getOutputStream());
    public static void fileSend (OutputStream os, String source) {
      //write your file onto the output stream
    InputStream in = new BufferedInputStream(downloadSocket.getInputStream());
    public static void fileReceive (InputStream is) {
      //Read from the input stream
    }This should work.. Good luck

  • Send many files through a socket without closing Buffered Streams?

    Hi,
    I have an application that sends/receives files through a socket. To do this, on the receiver side I have a BufferedInputStream from the socket, and a BufferedOutputStream to the file on disk.
    On the sender side I have the same thing in reverse.
    As you know I can't close any stream, ever.. because that closes the underlying socket (this seems stupid..?)
    therefore, how can I tell the receiver that it has reached the end of a file?
    Can you show me any examples that send/receive more than one file without closing any streams/sockets?

    Hi,
    As you know I can't close any stream, ever.. because that closes the underlying socket (this seems stupid..?)Its not if you want to continuosly listen to the particular port.. like those of server, you need to use ServerSocket.
    for sending multiple files the sender(Socket) can request the file to server (ServerSocket). read the contents(file name) and then return the file over same connection, then close the connection.
    For next file you need to request again, put it in loop that will be better.
    A quick Google gives me this.
    Regards,
    Santosh.

Maybe you are looking for

  • ESI deduction for mid joining employees

    Hi Friends For an employee joined in 05th Feb, master data salary is Rs.14768.77 (sum of wagetypes considered for ESI calculation)  and the actual salary calculated is Rs.12941.43. For the purpose of ESI deduction the calculated salary is projected f

  • Custom Login Screen

    I wanna know if i can develop a login screen diferent to the NW login screen. I mean that i want to create a view in WebDynpro that receives some parameters from user and execute the login cheking against the UME of Was. If so, i wanna know how to ch

  • Web gallery with feedback, and the viewer don´t sign in.

    I´v noticed that if I´m making a web gallery in Lightroom 6 and not in the web module, but a collection that I´v synced, then I can share it on the web. But if my client wants to comment or mark a photo then the client need to sign in to Adobe. Can i

  • 3rd party deal - VEIAV record is missing (Intrastat)

    Hello, Our customer is operating in EU country and thus is reporting Intrastat. There is a business case of purchase from CH (Switzerland), while the physical movement is triggered from DE (Germany). This is intra-community deal and must be in VEIAV.

  • Clarification required ..... Please help me.

    Hi experts can any one explain about these things. <b>Pay/No Pay:</b>     This is non-paid time, except that we must have a 40-hr week of paid time if code 019 is used at any time during the week. <b>A/Hrs Offset:</b>     Available hours offset. That