How to access a file in Unix server from windows using java

I want to access a file in unix server from windows using java program.
I have the following code. I am able to open the url in a web browser.
String urlStr="ftp:user:passwd@unix-server:ftp-port//javatest/test.csv;type=i";
URL url = new URL(urlStr);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream)));
String inputLine;
while((inputLine=in.readLine()))!=null){
System.out.println(inputLine);
in.close();
I get the following error
java.io.FileNotFoundException: /javatest/test.csv
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:333)
at java.net.URL.openStream(URL.java:960)
at com.test.samples.Test.main(Test.java:45)

urlStr="ftp:user:passwd@unix-server:ftp-port//javatest/test.csv;type=i";
I have given the format of the urlStr that I am using in the code. The actiual values are used in my code. I have tried pasting this url in the browser and it opens the file.

Similar Messages

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • 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.
    :)

  • How to access JNDI tree of Admin Server from Managed Server

    Hello,
    I created Managed and Admin Server for Domain.
    On Managed Server I use:
    InitialContext con = new InitialContext()
    It points to Managed Server local JNDI tree and
    Managed Server can't find JNDI tree of Admin Server.
    Looks like Managed Server is regular remote client of Admin Server.
    How to access JNDI tree of Admin Server from Managed Server?
    Thanks.
    Oleg.

    Hello,
    I created Managed and Admin Server for Domain.
    On Managed Server I use:
    InitialContext con = new InitialContext()
    It points to Managed Server local JNDI tree and
    Managed Server can't find JNDI tree of Admin Server.
    Looks like Managed Server is regular remote client of Admin Server.
    How to access JNDI tree of Admin Server from Managed Server?
    Thanks.
    Oleg.

  • CONNECT UNIX MACHINE FROM WINDOWS USING C#

    Hi all i have a requirement to connect unix machine from windows using c# code . I have the IP Address of the unix machine and the path too.I have to make a FTP using the c# code from unix to windows and vice versa . Can anybody help me out on this . It
    would be great if have a solution for this .

    Hi
    Balamurali_Mohan,
    Please refer to the similar thread
    How to connect to unix server using c#
    The marked answer said: Use a SSH (secure shell) client wrapper for .NET to connect to the remote UNIX machine and execute commands to run your script.
    Have a look at:
    http://www.codeproject.com/KB/IP/sharpssh.aspx
    Best regards,
    Kristin
    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.

  • How to compare 2 dates in SQL Server 2000 DB using Java?

    How do you compare 2 dates in SQL Server 2000 DB using Java?
    Let's say we have two fields: Date Reported and Target Finish Date.
    Date Reported is 09-10-2004 09:55:55: PM
    Target Finish Date is 09-12-2004 11:59:59: PM
    What i want to happen is i want to convert both dates to days and get the difference of the two.
    can SQL Server 2000 DB do this?

    it doesnt wrk.
    ok here's what i did:
    iv tested a simple code for this case.
    I created a table name tblDate which has 3 columns namely date_ID, date_From (datatype datetime), date_To (datatype datetime).
    I inserted 1 row: date_ID has the value 1, date_From has the value 10/22/2004, and date_To has the value 10/24/2004.
    i run the java code below:
    int days = 0;
              String query = "SELECT date_From, date_To cast(date_From-date_To AS int) AS Diff FROM tblZoo WHERE date_ID = '1'";
              try
                   DBConnect db = new DBConnect();
                   db.openCon();
                   ResultSet rs = db.execute(query);
                   while(rs.next())
                        days = rs.getInt("Diff");
                   db.closeCon();                         
              catch (Exception ex)
                   System.out.println("Error on Execution: " + ex);
              return days;___________
    an error occurred: Error on Execution: java.lang.nullpointerexception

  • How to write a file in unix server through oracle plsql code

    Hi All,
    My requirement is to create and write a file (any file for eg txt file) in unix box with in a specified directory through oracle plsql code.
    Oracle sits in windows server.
    using utl_file package we can create directory where oracle resides and write it there in oracle server in our case windows..
    But here we need to create,write a file but in unix server which is different server than where the oracle server resides..
    we are using Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    Can any one one please help me out in this issue...
    Thanks in Advance.
    Prakash

    Mr Prakash,
    Why are you asking this question multiple times in every forum you can spell?
    Valid responses have been presented to you already two times.
    Can you explain why you can't follow them up, but continue to abuse this forum by repeating doc questions?
    Sybrand Bakker
    Senior Oracle DBA

  • How to download  n  files  to FTP server in background using single report?

    Hi all,
    I have one requriement where i have to download 7 different text ( *.txt ) files to FTP server weekly using single program in background mode.
    I have populated all the 7 internal tables with their corresponding data.  But i dont know how to proceed further.
    Please help me out .....
    Thanks in advance..

    hi,
    U can store the Internal table name and File name in an internal table.
    Then loop at that table and call function called 'GUI_DOWNLOAD' inside that loop.
    Rgds,
    Sanjeet

  • How to access jpeg files on icloud drive from your iphone (5s)

    Can anyone tell me how to access a jpeg file on icloud drive from iphone? I have upgraded my macbook pro (with retina) to Yosemite, and my iphone is on ios 8.01 and I have turned on icloud drive. The only content I have seen online is accessing word docs through Pages which I get - but what about jpeg files? Thank you!

    At the moment, you can't.  A favourite complaint.  Hopefully, the situation will change in the near future, but only Apple knows when or if.

  • How to access .asl file in PSE 13 from old PSE 10?

    Can’t access .asl files I had used with PSE10 in PSE 13.  Computer: Mac OS 10.10.1  with PSE 13
    What I have done:
    1- .ASL files from PSE 10 were copied to PSE 13:  Mac HD> applications > PSE13 > Support files  > Presets > styles
    2- Closed PSE 13 and opened again
    3-  Tried to add styles with Preset Manager. Message is  “Sorry that style set has already been loaded”
    4- The only styles I can access are from the Effect/Styles panel and only the ones that came with PSE13, not my old .asl files I had been using with PSE10.

    finally found the answer here:  How to Load Layer Styles in Photoshop Elements | theStudio | Digital Scrapbooking Studio

  • Can't see files/folders on server from windows

    i'm not sure if this is related to the ACL issue (not being properly honored in Samba on Leopard), but i'll explain my problem and hopefully someone can point me in the right direction
    i've set up file sharing with my server on several Macs and a couple of PCs without a problem, but on one PC, when i connect to the server, i can't see any folders at all on the server in the Explorer window. i also can't move files to the server as it tells me i don't have permissions. i am certain this is set up the same as the other PCs and ensured that the Windows user has file sharing enabled on my server.
    please note that i'm fairly new to setting up a server so not too much jargon please!
    cheers
    ric

    The problem may be how the CD was formatted. Macs support ISO-9660 better than any other crossplatform format.
    Recently Software Architects has improved UDF support on the Mac, though I have yet to test it to see how true their claim is:
    http://www.softarch.com/us/products/rdvd.html

  • How can I move files or complete websites from Windows 7 to Nexus 7 for Firefox, without using sync?

    I'm writing documentation telling end users how to move large websites (up to 4GB, including PDFs but not sound or video) from Windows 7 to Nexus 7 (Android 4.2.2) to be used offline there -- preferably moving the site by a wired connection, instead of using Firefox sync. I have the latest Adobe plug-in, and the latest Java from Oracle, on the Nexus 7 (it would be nice if it were not necessary to download these after downloading the latest Firefox for the Nexus, but I suspect that's not Mozilla's fault).
    So I saved a small test PDF file on the Nexus 7 (to see what download folder it got put into -- it showed up in sdcard/Download/). However, when I move a small PDF (that was NOT created on Nexus 7) from Windows to Nexus 7 (through the USB wire) to the same folder, the file does show up there as expected (as seen by ES File Explorer), but is invisible to Firefox.
    Also there are several files left over in that folder from a previous installation of Firefox on the Nexus 7 (I uninstalled and re-installed Firefox, for a blank-slate test). I would also like to make these files visible in the new installation of Firefox, in order to delete them.
    How can I instruct the end user to change permissions or whatever on the Nexus 7, or otherwise cause certain PDF or HTML files in the sdcard/Download/ folder to also be visible to Firefox?

    The best way to do things is to use sync. If you wish do use other methods it would become complicated.

  • Call Unix Command From Reports Using Java

    Hi,
    Could somebody please show me a sample coding to call Unix command from 10g report using java?
    In metalink doc id 361857.1 does not show much.
    Thanks,
    neemin

    Hi,
    I have a problem with synchronization of the java commands.
    In the Before Parammeter Form trigger, I have:
    function BeforePForm return boolean is
    rt ORA_JAVA.JOBJECT;
    proc ORA_JAVA.JOBJECT;
    v_txt varchar2(32000);
    i integer := 0;
    v_cd_modulo int;
    v_arqlog text_io.file_type;
    cursor c_evento is
    select codigo,
    nome
    from
    (select e.cd_evento || e.cd_edicao codigo
    ,nm_evento nome
    from grh_ev_evento e
    where e.CD_GRUPO in (select cd_grupo
    from grh_ev_adm
    where cd_usuario = (select cd_usuario
    from usuario
    where login_usuario = :AUTHID)))
    order by substr(nome, 11);
    begin
    -- Create the context for logged user
    if instr(upper(nvl(:AUTHID,'RWCLIENT')),'RWCLIENT') > 0 then
    :AUTHID := :SSO_USUARIO;
    end if ;
    TCEENV.SET_TCEENV(:AUTHID);
    if PK_SCA.SCA_GET_USER_RIGHTS(:sca_module_name, :AUTHID) IS NULL then
    srw.message(100, 'Access denided!');
    return (FALSE);
    end if;
    -- Create file in Report Server (UNIX)
    v_txt := '<BR>' || htf.formSelectOpen('P_EV_EDICAO', 'Evento: ');
    :p_file := '/u03/SCAWEB/repout/' || :sca_module_name || '_' ||
    pk_sca.sca_encrypt(:AUTHID || to_char(systimestamp, 'ss.ff'));
    v_arqlog := text_io.fopen (:p_file, 'A');
    text_io.put_line (v_arqlog, v_txt);
    for reg in c_evento loop
    i := i + 1;
    if i = 1 then
    v_txt := '<OPTION SELECTED VALUE="' || reg.codigo || '">' || reg.nome;
    else
    v_txt := '<OPTION VALUE="' || reg.codigo || '">' || reg.nome;
    end if;
    text_io.put_line (v_arqlog, v_txt);
    end loop;
    v_txt := '</SELECT></CENTER></form></BODY> </HTML>';
    text_io.put_line (v_arqlog, v_txt);
    text_io.fclose (v_arqlog);
    SRW.SET_AFTER_FORM_HTML(SRW.FILE_ESCAPE, :p_file);
    rt := RUNTIME.GetRuntime();
    proc := RUNTIME.exec(rt,'rm ' || :p_file);
    return (TRUE);
    end;
    The problem is that there isn't a "synchronize" command, and the
    RUNTIME.exec(rt,'rm ' || :p_file) don't works (it does nothing) because
    the SRW.SET_AFTER_FORM_HTML has a large delay and the following
    command is ignored.
    How can I solve it?
    thanks,
    lmprestes

  • How to access the client PCs via RDP FROM Windows Server 2003

    Hopefully this is not an ignorant question, but every thread I've read focuses on client PCs not being able to access the terminal server. I have the opposite problem. I am working remotely and have full access to the servers (some of which are virtuals).
    I need to be able to connect to the various workstations, but I cannot.  Is this just a setting I have misconfigured?  Is there any software I can deploy to these PCs that will allow me to log in and update their workstations?
    Any help is sincerely appreciated.
    - Jeff

    Hi Jeff,
    Thank you for your posting in Windows Server Forum.
    You can able to take RDP for client system from server. But keep in mind that; client system can only allow 1 RDP session at a time for administrator purpose. For that you need to have permission for taking rdp session. 
    Also you need to verify that “Remote Desktop Service” service is running and also need to verify the below thread as per snap.
    In addition, if you want to manage all the server and client system, then you can use Remote Desktop Connection Manager to manage all the client and server remotely.
    Hope it helps!
    Thanks.
    Dharmesh Solanki

  • How to download a directory into local machine from FTP using java

    Hi,
    I want to download a directory from FTP. How can i achieve this.
    Regards,
    Ahamad

    Achieve what? How about thinking about what you really have to do in detail? That way you might find out how it'll work and what to implement.
    By the way, there are many Java FTP libraries (e.g. NetComponents.jar) available. Google will find them, and you can use them to do at least the accessing part of your program.

Maybe you are looking for