How to pass username and password to ftp server using jdk1.4

My following codes runs fine when i give full access to the anonymous user on ftp server. But when the ftp server is password protected the code gives me error
"sun.net.ftp.FtploginException"...How can i solve it???
import java.net.*;
import java.io.*;
import java.security.*;
class Dnet
public static void main(String r[])
try
File fi=null;
FileInputStream fis=null;
BufferedReader buff=null;
OutputStream os=null;
InputStream ins=null;
String s=null;
String ar[]=null;
int i=0;
String li=null;
String ht="i will be there for u";
fi=new File("c:/nick");
ar=fi.list();
System.out.println(ar[0]);
for(i=0;i<ar.length;i++)
URL ul1=new URL("ftp://pg-12/satyen/"+ar);
URLConnection ucon=ul1.openConnection();
ucon.setDoOutput(true);
os=ucon.getOutputStream();
fis=new FileInputStream("c:/nick/"+ar);
buff=new BufferedReader(new InputStreamReader(fis));
while((li=buff.readLine())!=null)
os.write(li.getBytes());
os.flush();
os.close();
}catch(Exception e)
System.out.println("error is: "+e);
}

Hi,
you need to extend the URL to :
ftp://user:password@host/path/file
e.q :
URL ul1=new URL("ftp://user:passwd@pg-12/satyen/"+ar);
SKA

Similar Messages

  • Reg : How can I get  Username and Password in FTP Server in HANA

    Hi All,
      Any one can you please guide me....How can i get username and Password of FTP Server in SAP HANA?
    Regards,
    Arjun

    Hi Arjun,
    Are you looking for external authentication(External ID option) in HANA Studio instead of logging by entering HANA User and Pwd(which is internal)?
    You can look for the following Security guide which will give you some insight on this.
    http://help.sap.com/hana/hana1_sec_en.pdf
    Rgds,
    Murali

  • How to pass username and password with the portal url

    i want to access portal from my web site. i have created username and password fields in my web page. when submited , my portal page should open. so how to pass username and password with the portal url.

    This is not straightforward; but it is doable.
    First tell us about your portal version; portal 10.1.4 has a slightly different method of doing it and the pre-10g portals were completely different animals.
    And if you are in AS Rel 2, then the most important document for you would probably be the following:
    [Creating Deployment Specific Pages| http://download-west.oracle.com/docs/cd/B14099_19/idmanage.1012/b14078/custom.htm#i1015535]
    You might want to use it in conjunction with some metalink notes about your portal version and such a login page.
    hope that helps!
    AMN

  • How to pass Username and password using Invoke to a webservice

    Hi Guys,
    Please tell me how can I pass Username and password using Invoke to a webservice, I am using SOA 11G.
    Thanks
    Yatan

    Hi Yatan
    I suppose you want to use basic HTTP authentication.
    Try to lookup in the SOA docs this property
    oracle/wss_http_token_client_policy
    http://download.oracle.com/docs/cd/E17904_01/web.1111/b32511/configuring.htm#WSSEC2261
    Regards
    Mihai

  • How to pass username and password while invoking a web service through wsdl

    Hello All,
    i am calling a web service through wsdl, but it is giving error 401. i want to know how to pass userid and password when i am invoking webservice?
    i am using NetBeans 6.1.
    i did following thing:
    First i created one web application, then i right clicked on project new->web service client, and gave the url for my wsdl.
    after that i create one main class and try to call my required operation by that wsdl.
    Thanks in advance

    Thanks dumchikov, i tried the same thing what ever you told but there is no option for security.
    when i right clicked on web service reference its open 1 window which have 2 tab one is quality of service and second is wsdl customization, then i clicked on wsdl customization. which contain Global Customization, Port Types, Port Type Operations, Port Type Faults, Binding, Binding Operations, Services, Ports and External Binding Files. it don't have security option.

  • How to pass username and password from form to web service

    Hi All,
    We need to develop an offline interactive to form.
    When on desktop computer, the user has to click on button and it calls a web service (exposed via PI ) which updates the backend.
    But backend needs an authorised user for updation. We have a dummy user with authorisations.
    But how to pass the that username with its password to web service
    Please give your suggestions
    Regards,
    Aditya Deshpande

    i am closing this thread

  • How to Hide username and password in command line using maxl

    Hi,
    How to encript my user name and password in command line prompt when I am login to Essbase server using batch file:
    *1_Here is my batch file:*
    Name of the bat file AV_Assig_Var1.bat
    rem This batch file defines the following variables:
    set $1 = 'admin';
    set $2 = 'password';
    essmsh AV_Asig1.mxl admin password
    ===========================
    *2_Here is my maxl file:*
    Name of the bat file AV_Asig1.mxl
    /* Create a process log */
    spool on to 'D:\lova\spool_log.txt';
    /* login (using variables from a batch file */
    login $1 $2 on 10.42.100.229;
    /* create application and database */
    create application AV_Asig1;
    create database AV_Asig1.AV_DB;
    /* End process log */
    spool off;
    exit;
    *3_Command line prompt*
    D:\Ess>AV_Assig_Var1.bat
    D:\Ess>rem This batch file defines the following variables:
    D:\Ess>rem 1: username
    D:\Ess>rem 2: password
    D:\Ess>essmsh AV_Asig1.mxl admin password
    Essbase MaxL Shell - Release 9.3.1 (ESB9.3.1.0.0A181)
    Copyright (c) 2000, 2007, Oracle and/or its affiliates.
    All rights reserved.
    MAXL> login admin password on *10.46.100.222*; /* I want to hide this information */
    OK/INFO - 1051034 - Logging in user [admin].
    OK/INFO - 1051035 - Last login on Monday, June 14, 2010 12:44:03 PM.
    OK/INFO - 1241001 - Logged in to Essbase.
    MAXL> create application AV_Asig1;
    OK/INFO - 1051061 - Application AV_Asig1 loaded - connection established.
    OK/INFO - 1054027 - Application [AV_Asig1] started with process id [6792].
    OK/INFO - 1056010 - Application AV_Asig1 created.
    MAXL> create database AV_Asig1.AV_DB;
    OK/INFO - 1054014 - Database AV_DB loaded.
    OK/INFO - 1056020 - Database AV_Asig1.AV_DB created.
    MaxL Shell completed
    D:\Ess>
    I am looking forward to inputs from anybody.
    Thanks & Regards,
    Deepthi.

    Beyond that thread, I gave a presentation at Kaleidoscope last year around MaxL that goes into quite a bit of depth re encryption and a whole bunch of other MaxL goodies.
    To download it, go to www.odtug.com, click on Tech Resources, Essbase/Hyperion, and use the search box for MaxL.
    There are two presentations, one by Tracy McMullen and the other by me. Tracy's is a good introduction to the various command groups; my presentation focused on a few areas in depth, one of which was encryption. The title is "Master Essbase with MaxL Automation".
    You will need to join ODTUG to download the presentation, but there is a junior membership that is free.
    Regards,
    Cameron Lackpour
    P.S. ODTUG Kaleidoscope 2010 is coming up in two weeks, starting on 27 June 2010 -- for those of you still on the fence, it is an awesome conference and I urge you all to come. The content this year will be fantastic.

  • How can I pass username and password in a client bean to call a webservice?

    Hi,
    I have created a Client Java Bean for a web service (an automatically created Service from a Bapi) that requires username and password. How can I pass username and password in the code?
    Thank you!
    Julia
    This is my code:
    public Z_FlightGetlist port;
    Business Method.
    public String test1234() {
    try{
    BAPI_FLIGHT_GETLIST list = new BAPI_FLIGHT_GETLIST();
    list.setAIRLINE("KLM");
    port.BAPI_FLIGHT_GETLIST(list);
    return "ok";
    catch(Throwable e){
    return "error"+e;
    public void ejbCreate() throws CreateException {
    try{
    InitialContext ic = new InitialContext();
    Z_FlightGetlistService s = (Z_FlightGetlistService)ic.lookup ("java:comp/env/FlightProxy");
    Z_FlightGetlist vi = (Z_FlightGetlist)s.getLogicalPort(Z_FlightGetlist.class);
    this.port = vi;
    catch(Throwable e)

    Hello Julia,
    Check this document
    http://help.sap.com/saphelp_nw04/helpdata/en/50/a5d13f83a14d21e10000000a1550b0/frameset.htm
    Best regards, Maksim Rashchynski.

  • How to retrieve WorkflowContext without passing username and password ?

    Hi,
    I have created a dynamic ApprovalGroup and inside this class i have the following private method.
    private IWorkflowContext fetchWorkflowContext() {
              IWorkflowServiceClient wfSvcClient =
                   WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.LOCAL_CLIENT);
              ITaskQueryService queryService = wfSvcClient.getTaskQueryService();
              IWorkflowContext workflowContext;
              try {
                   workflowContext =queryService.authenticate("weblogic", "weblogic1".toCharArray(), null);
                   } catch (WorkflowException e) {
                   e.printStackTrace();
    But when i retrieve workflowContext, I have to pass username and password.As this dynamic ApprovalGroup class will be deployed on the same SOA server under D:\Oracle\Middleware111150\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1
    I have kept wf_client_config.xml under D:\Oracle\Middleware111150\Oracle_SOA1\soa\modules\oracle.soa.ext_11.1.1\classes.
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <workflowServicesClientConfiguration
    xmlns="http://xmlns.oracle.com/bpel/services/client">
         <server name="default" default="true" excludeFromFederatedList="true">
         <localClient>
              <participateInClientTransaction>false</participateInClientTransaction>
         </localClient>
         <remoteClient>
              <serverURL>t3://localhost:8001</serverURL>
              <userName>weblogic</userName>
    <password>weblogic1</password>
              <initialContextFactory>weblogic.jndi.WLInitialContextFactory</initialContextFactory>
              <participateInClientTransaction>false</participateInClientTransaction>
         </remoteClient>
         <soapClient>
              <rootEndPointURL>t3://localhost:8001</rootEndPointURL>
              <identityPropagation mode="dynamic" type="saml">
                   <policy-references>
                   <policy-reference enabled="true" category="security" uri="oracle/wss10_saml_token_client_policy"/>
                   </policy-references>
              </identityPropagation>
         </soapClient>
         </server>
    </workflowServicesClientConfiguration>
    How to retrieve WorkflowContext without passing username and password ?
    ============================
    workflowContext =queryService.authenticate("weblogic", "weblogic1".toCharArray(), null);
    ============================
    regards.
    Edited by: user10303338 on Oct 5, 2011 1:51 AM

    Use :
    Properties prop = System.getProperties();
    prop.put("proxySet","true");
    prop.put("http.proxyHost","yourProxy");
    prop.put("http.proxyPort","8080"); // change the port
    //prop.put("https.proxyHost","yourProxy");
    //prop.put("https.proxyPort","8080"); // change the port
    Denis

  • JMS Adapter (for DI) does not allow passing username and password to JMS connection

    Post Author: PLed76
    CA Forum: Data Integration
    JMS Adapter (for DI) does not allow passing username and password to JMS connection. It has those fields only for MSMQ. Our Production environment does not allow us to connect to JMS (we use Tibco EMS) anonymously, so it prevents us from use of Data Integrator. Is there any way to pass those params, or obtain the correct version of JMS Adapter, or obtain source codes of the JMS Adapter so we can correct them ourselves (we can send you the corrected sources back) ? Thanks in advance for any help. (PL)ed76 Renaissance Capital

    Bump - Were having the same issue.
    Has anyone found a way to connect to Tibco with a user/pwd?
    Version 14.0.297.

  • How to pass user and password in workspace when open a bqy

    hello,
    how to pass user and password of workspace when refresh a bqy for a query in DB2.
    I don't know where to insert the properties in order to use user and password of workspace,
    I want to use user of login of workspace,
    I don't want to make to appear the mask of login newly when the user refresh the query.
    I don't want to set a default user and password
    thanks
    massimo

    Dear Friend,
    What you mean?
    1. Do you mean how to pass login page on workspace ?
    2. or Do you mean how you can use a connection file to connect to db that is hide from user?
    3. or You mean how to use user & password to login to doc on workspace
    Answer for 1:
    use link
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy?user=admin&pass=password
    Answer for 2:
    a) Upload or import connection file ( MyConn.oce ) to DB2 into workspace,
    b) for IR doc properties change file connection ( MYConn.oce )
    Answer for 2:
    use link without user & pass parameter
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy <?user=admin&pass=password>
    regards
    siyavuş

  • Pass username and password adfs without using query string

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hello MohitJainMJ,
    You're not in the right forum. Here it's for FIM topics!
    Regards,
    Sylvain

  • Pass username and password ADFS without using query string, Please help.

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hi,
    According to your post, my understanding is that you had an issue about the ADFS.
    As this issue is related to ADFS, I recommend you post your issue to the forum for ADFS.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding and support.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • Dynamically pass the username and password to report server to invoke reports

    Hi
    The scenario is as follows:-
    9iAS is installed under - Windows 2000 (web server and report Server 6i) and everything works fine.
    We have developed a page using pl/sql cartrige (oracle 8i), from that a report is invoked with some parameters. However, the userid and password is stored under keymap file (cgicmd.dat).
    Is there anyway to pass dynamically the username and password to report server in order to invoke the report.?
    Can any one advise?
    null

    Check out
    http://serverfault.com/questions/371907/can-you-pass-user-pass-for-http-basic-authentication-in-url-parameters
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • How do I pass username and password to the Citrix client via netlet

    I have managed to call a Citrix managed application from the portal via netlet (via InitialProgram within citrix_start.html) - thankyou William Geurts.
    How do I use the Portal's single sign-on functionality to pass the username and password through to Citrix via netlet?

    Hi,
    This can be done by writing a small application that will pull session/user info from Portal and then pass it on to another app as needed.
    Thanks,
    Raj_indts
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

Maybe you are looking for

  • MesageSplit in Mapping without  BPM ( JDBC-XI-Webservice )

    I need to split Source message which has multiple records into multiple Target Messages. For Example I have to put 1000 records into each Target Message. Source: emp_recs emp_data occurs 0..unbounded   emp_name 1   emp_dept   1 Target: target-emp occ

  • Global variable to capture username with Form 6i

    Hi everyone, I have a menu created with Forms 6i and the shortcut that I use to call the menu has in its target the following: C:\orant\BIN\ifrun60.EXE userid=username/password MYFORM.FMX When I remove the username and password from the shortcut targ

  • Oracle Application Report Server Installation

    Dears, I am new to Oracle AS, i need to know how to do the full installation of Oracle Application Report Server. Please, it will be highly appreciated if you provided me detailed Document for this. Please, i need also exactly where can i edit the Or

  • Turn off scroll pane component

    have scroll pane component applied to an image within a movieclip timeline. after clicking to the frame with the scroll pane, every frame thereafter has the scroll pane image in the background.

  • Read a character without enter

    I need to read a character from the keyboard , but I want it read without hitting <enter> to start the reading; the system should be waiting for for a key to be hit, and right after the hitting it should know which key it was; it's absolutely importa