Commons net and retrieve complete dir structure

Hi everybody,
I'm using commons net from apache to connect and download files from a FTP site.
I have a question: is there any easy (and quick above all...) function to get the complete directory structure of FTP site without using recursively the listFiles() method, which takes a LOT of time?
I only need to syncronize a local dir structure to the FTP one. I don't need to download any file. Many thanks for your help.

1) I like to retrieve ftp files only with some
extensions like *.txt or *.jpg etc. How can we
retrieve files with specifying file extension?
List the files and then filter the list to those that you want to process.
2) I need to compare the FTP Files with the local
files before downloading from the FTP Server?Think about this one! To compare two files you nead to read both. If you do this on the client then you will have to copy the file from the server first!
>
3) I need to move files from the ftp server to local
directory. Is there is anyway to move the files
rather than first retrieve files from the FTP Server
and then deleting the file in the FTP Server using
FTP delete()What is wrong with copy then delete?

Similar Messages

  • How to export and import complete organization structure?

    Hello,
    I wanna import many (maybe 300) organization XML ObjectGroups in the right order.
    I tried something like that (see the code below),... but this solution only works for one file.
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE Waveset PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <Waveset>
    <ImportCommand name='include' file='c:/import/org001.xml'/>
    <ImportCommand name='include' file='c:/import/org0011.xml'/>
    <ImportCommand name='include' file='c:/import/org002.xml'/>
    </Waveset>I tried to use wildcards like *,%,... the result is an error message :(
    e.g.
    file='import/org001*.xml'/>Has anyone experiences with that case?
    There are an another way to export and import complete organization structure in IDM 8.x ?
    greets and thx

    Hi, Since you are using an program to transform the org structure to XML file,
    why not write another program, just to generate the including list?
    Then import from the file?
    PS: How to generate the organization xml?
    Some file looks like the following? But how to generate those IDs of its parent is a problem...
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE ObjectGroup PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <!-- MemberObjectGroups="#ID#Top" displayName="test4" name="096242075B658F30:4D058C8A:12181263D1D:-79e7"-->
    <ObjectGroup name='096242075B658F30:4D058C8A:12181263D1D:-79e7' displayName='test4' creator='Configurator' createDate='1243497029859' lastModifier='Configurator' lastModDate='1243497029859' primaryObjectClass='ObjectGroup'>
    <PathFromTop>
    <List>
    <String>#ID#Top</String>
    <String>#ID#E706-:F4B18168121:1AE80FB6:03F856B570242690</String>
    </List>
    </PathFromTop>
    <MemberObjectGroups>
    <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
    </MemberObjectGroups>
    </ObjectGroup>

  • How to store and retrieve XML messages in AQ using ESB/ BPE

    Hello,
    I am having a requirement which I feel should be fairly common - store and retrieve XML messages in AQ. However, I am struggling to decide which type of queue to use AQ or JMS...Here is the requirement
    1. In an ESB, I want to read different kind of files using file adapter. Different kind as in, having different structure or schema
    2. I want to create a queue that is capable of storing any kind of xml data. To this queue, I want to enqueue the message read in step 1.
    3. In another process, say a BPEL, I want to dequeue the message and write into a file. The filename is retrieved from one of the header properties. I want to dequeue using a stored procedure, not by using a JMS or AQ Adapter (reason being that these adapters poll the queue, and consume a message immediately. However, I want to consume the message only when there is a business need)
    My questions are:
    1. What kind of queue I should create in the DB (What should be its payload type...XMLType? )... I guess the answer would also determine the adapter to be used - JMS or AQ
    2. How I should map the xml data read from the file in step 1 to this adapter
    Any help is highly appreciated.

    You are right in suggesting that I dont need to store my XML data as xml in the DB...I dont want to too :) but its just that, thats the only option I can see at this time (the other track i am exploring is :
    File adapter(XML) -&gt; Convert to opaque (base64binary) -&gt; Enqueue opaque to JMS (aq$_jms_bytes_message) -&gt;Dequeue Opaque -&gt; Write file opaquely.
    In this I have hit the roadblock in trying to convert XML to base64binary...maybe some custom java function is needed...anyway)
    Coming back to this thread, where I am trying the following
    File adapter(XML)  -&gt; Enqueue as XML to queue  -&gt;Dequeue XML -&gt; Write file opaquely.
    PS: I think its important for me to mention that I am using SOA 10.1.3.1.0
    I tried the steps you gave...after creating the queue, I am trying to create a JMS adapter. But the queue I created doesnt show up in the browse window of destinations for the JMS Adapter..That had led me to infer that JMS adapter cant be used
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_row_type AS OBJECT
    (update_queue_id NUMBER
    ,upc VARCHAR2(20)
    ,price1 NUMBER);
    {color}
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_rec_type AS VARRAY(9999999) OF batchupdate_row_type;
    CREATE OR REPLACE TYPE payload_type AS OBJECT ( payload batchupdate_rec_type);
    EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ( queue_table =&gt; 'jmsuser.batch_update_queue_table', queue_payload_type =&gt; 'payload_type');
    EXECUTE DBMS_AQADM.CREATE_QUEUE ( queue_name =&gt; 'batch_update_queue', queue_table =&gt; 'jmsuser.batch_update_queue_table');
    EXECUTE DBMS_AQADM.START_QUEUE ( queue_name =&gt; 'batch_update_queue'); {color}
    I also needed some opinion on whether the last step of my proposed solution ( Dequeue XML -&gt; Write file opaquely) is possible. As I want to develop a service oblivious of the structure of the file, I dont want to create a file adapter based on a particular xsd...so I want to write whatever xml I am getting from the queue....is this step possible

  • Apache Commons Net deployment fails to resolve, JDev classpath question

    I wrote a wrapper to apache's most recent version of commons-net package (version 1.4.1) to allow me to execute FTP services from an Oracle 9i2 database. After adding the common-net .jar file to the JDev libraries, and including this library in my project, I debugged the code in Jdeveloper, then deployed to the Oracle 9i2 server. However, many classes of the of the common-net (and my code) failed to resolve in the database.
    After downloading open source product DependencyFinder, and running against the Commons-net .jar file, I found that some packages were dependent on the Apache ORO regexp package. The ORO package, as far as I can tell, is not in any classpath that my JDev project uses. There is listed in the JDev libraries, a library called Apache Regexp, but I did not include that in the project, either.
    After I downloaded the ORO package from Apache, added it to JDev's libraries, included it in my project, and added the ORO library to the list of classes to deploy (using the loadjava deployment profile), deployment to Oracle 9i2 of the my classes, the commons-net classes, and the ORO classes properly resolved.
    My question is: Why did my application work under JDeveloper? How and where did it find the ORO classes?
    The version of Java under which JDeveloper is running, and the version being used as the compiler for this project, is a new installation of JDK1.4.2_10.

    Since the commons net 1.4.1 is compatible with jdk 1.3.1, I should only need to use loadjava on the .jar file. In fact, that works, given that there is no failure on load due to incompatible .jar or .class files structure.
    But, I've just solved this part of the problem. The commons net 1.4.1 is dependent on, but does not include the Apache ORO library. Once the ORO library was deployed to Oracle 9i2, all common net 1.4.1 classes were resolved.
    The "problem" is with JDeveloper. Without including the ORO library in the JDeveloper application, or in the classpath, it worked under JDeveloper -- the more surprising since I had never downloaded the ORO library from Apache. Only after downloading ORO, explicitly defining ORO to JDeveloper, and including ORO as a library in my JDeveloper project, did the deployment of the application to Oracle 9i2 succeed (though the application always executed successfully under JDeveloper).

  • Apache Commons Net FTP : ListFiles not displaying all dirs and files

    So I am doing this:
    FTPClient f = new FTPClient();
    f.connect("foo.bar.com");
    boolean login = f.login("User","Pass");
    FTPFile[] list = f.listFiles();
    When I doing a "list.length" I get 2. When I list it out it just shows that it retrieved the directories only. I know there are more files there....
    Here is the wierd thing. When I manually FTP from this Windows box and do a dir I only get the two listings. When I FTP from my linux box I get the full directory listing (those two directories and more files).
    Any ideas as to why I am not picking these up?
    Thanks,
    Michael

    File permissions / hidden / visible etc?

  • Apache Commons Net - Retrieve File - Extension, Compare , Move - FTP Server

    Dear All,
    I am using Apache Commons net FTP Library for FTP Operations. I had a few doubts
    1) I like to retrieve ftp files only with some extensions like *.txt or *.jpg etc. How can we retrieve files with specifying file extension?
    2) I need to compare the FTP Files with the local files before downloading from the FTP Server?
    3) I need to move files from the ftp server to local directory. Is there is anyway to move the files rather than first retrieve files from the FTP Server and then deleting the file in the FTP Server using FTP delete()
    Thanks,
    J.Kathiresan

    1) I like to retrieve ftp files only with some
    extensions like *.txt or *.jpg etc. How can we
    retrieve files with specifying file extension?
    List the files and then filter the list to those that you want to process.
    2) I need to compare the FTP Files with the local
    files before downloading from the FTP Server?Think about this one! To compare two files you nead to read both. If you do this on the client then you will have to copy the file from the server first!
    >
    3) I need to move files from the ftp server to local
    directory. Is there is anyway to move the files
    rather than first retrieve files from the FTP Server
    and then deleting the file in the FTP Server using
    FTP delete()What is wrong with copy then delete?

  • How to copy a dir structure with files and subdir's in to another dir

    Hi there.
    How can i copy a dir structure with files and subdirs to another dir structure
    ie., all files and dirs in side the dir c:\aDir to c:\copyDir so i should get like c:\copyDir\aDir(all the files and subdirs of adir here)
    Thanks in advance
    Muthu

    File f = new File(dirName);
    if(f1.isDirectory()) {
    String list = f.list();
    then u have perform file io for each file and copy them to dir u want
    [email protected]

  • Wish to store and retrieve a structure

    Dear Friends,
    I am new to BerkeleyDB .I need some clarifaction in how to use the get and put api's . I want to know when to use the ulen and DB_DBT_USERMEM. when should i use,i mean when to use while retriving and storing.
    I will be happy to get a simple example code taking a key and value from a structure.
    Thanking you in advance
    B.Narendran

    Hi Narendran,
    If you are not using cursors to retrive and store key/data pairs in the database, and you have multiple threads, then you should use one of those flags: DB_DBT_MALLOC, DB_DBT_USERMEM, DB_DBT_PARTIAL. For more information, you can check here: http://www.sleepycat.com/docs/api_c/dbt_class.html
    For example, when using the non-cursor Berkeley DB calls to retrive data (like DB->get), in a multithreaded application, the memory to which the pointer stored into the Dbt refers is valid only until the next call using the DB handle returned by DB->open. For this reason, if the DB_THREAD handle was specified to the DB->open method, either DB_DBT_MALLOC, DB_DBT_REALLOC, or DB_DBT_USERMEM must be specified in the DBT when performing any non-cursor key or data retrieval. For more information: http://www.sleepycat.com/docs/ref/program/mt.html
    Regards,
    Bogdan Coman

  • HT1386 After a full system update phone and comp, some of my contacts have been lost and most of them now only have the numbers remaining, can the lost contacts be retrieved completely somehow.

    After a full system update phone and comp, some of my contacts have been lost and most of them now only have the numbers remaining, can the lost contacts be retrieved completely somehow.

    At some point in the past, I synched with Gmail.  Looking at my Gmail contacts, I can see that it's missing the same contacts I'm currently missing from the iPhone.  Is it possible that I may have done that sync back in October 2009 (but not since) and then somehow recently over-wrote my contacts content with whatever was there?  Is there some setting I could have tripped to make something like that happen?

  • Message no. KD503 - Complete allocation structure K1 for Internal Order

    Hi,
    During Internal order settlement through KO88 I am getting this error as :
    Message no. KD503 - Complete allocation structure K1
    Diagnosis :
    During settlement, the system puts the sender debits into groups  (assignments), which are settled using the same settlement cost element. The settlement assignment is made in the allocation structure, which is stored in the settlement rule for the sender (under settlement parameters). Cost element 430500 cannot be assigned to a settlement cost assignment in allocation structure K1, and therefore it cannot be assigned to a  settlement cost element.
    Procedure :
        Possible solutions are as follows:
        o   If the posting under cost element 430500 was made to the sender because of an incorrect entry, and you can reverse the posting, and do not need to update the allocation structure. You only need to reverse the incorrectly assigned posting before repeating the settlement. Exception: For an investment measure with a line item settlement, you need to extend the allocation structure, even after the reversal.
        o   If the posting was made correctly, you can do the following:
    a)  You can assign a different allocation structure to the sender: In the master data maintenance for the sender, choose
        "Settlement rule -> Goto -> Settlement parameters" and then enter a different allocation structure.  If necessary, also check whether the correct allocation structure is entered in the settlement profile. The allocation structure is defaulted  in the settlement profile when you create sender master data or when you maintain the settlement  rule.
    -   You can update allocation structure K1
    The same configuration in  Development Server there is no error but problem occurs in Quality server. Here the process is Internal Order creation - Creation of Reservation through MB21- Goods Issue against reservation  through MB1A and finally settlement through KO88.  During settlement this error occur. In configuration setting of allocation structure under Internal Order I have mentioned only revenue settlement (as per business) against assignments. Under source mentioned cost element group and under settlement cost elment Receiver Cat is "CTR" and tick "By Cost Element".
    During MB1A i.e, goods issue accounting entry is generated as
    81(Dr). 430500 Constimptuion Saprae and Stores
    99(Cr). 310411 Inventory Machinery and Spare.
    During settlement this debit figure should credit. But not allowiing to credit. Even in configuration under settlement cost element if I remove the tick of "By cost element" and mention secondary gl account whose cost element category is 21, still showing the same error in QA server. What may be the probabale solution ? Even if i remove allocation structure K1 from settlement profile 20 still same error exist. How this link gets during settlment inspite of removing allocation structure from settlement profile...
    NB.. COPA is not implemented in our company. So PA structure should not arrise here....
    Thanks & regards,
    Samrat
    Edited by: Samrat Roy on Aug 30, 2010 7:28 PM

    Hi Samrat,
    The issue is very simple.. Cost element 430500  is posted in your IO...
    While settling you have 2 options... Either you can credit the original GL account 430500.. This happens when you tick "By Cost element".. This you have done already...
    2nd option is not to tick "By Cost element" and assign a secondary cost ele category 21...
    But for any of these options to work, you have to include GL 430500 in the "source"... The above 2 options apply only to those GL accounts which are mentioned in the "Source".... for rest of the GL accounts, system gives this error
    Include 430500 in your "source" cost ele group.. Error will be resolved
    Regards
    Ajay M

  • While Doing Production Order Settlement "Complete Allocation structure" :

    Dear Experts
    I am Getting This Problem ,
    please give me A suitable Solution.
    I am created Another Allocation Structure And Assigned to Settllement Profile . But it is not trigering. Not Capturing That allocation
    Complete allocation structure Z1
    Message no. KD503
    Diagnosis
    During settlement, the system puts the sender debits into groups (assignments), which are settled using the same settlement cost element. The settlement assignment is made in the allocation structure, which is stored in the settlement rule for the sender (under settlement parameters).
    Cost element 40512006 cannot be assigned to a settlement cost assignment in allocation structure Z1, and therefore it cannot be assigned to a settlement cost element.
    Procedure
    Possible solutions are as follows:
    u2022     If the posting under cost element 40512006 was made to the sender because of an incorrect entry, and you can reverse the posting, and do not need to update the allocation structure. You only need to reverse the incorrectly assigned posting before repeating the settlement. Exception: For an investment measure with a line item settlement, you need to extend the allocation structure, even after the reversal.
    Edited by: rajamallu on Jul 2, 2010 10:41 AM

    Hi,
    within allocation structure customizing you create assignments for allocation structure Z1.
    Each assignment has a source (cost element, cost element range, cost element group).
    The cost element 40512006 is not included in the source definition of allocation structure Z1 but there are values to be settled available on your sender.
    Thus they cannot be settled and thats why the message occurs. So maintain alloc. structure Z1 completely.
    Best regards, Christian

  • WPF- How to save and retrieve details from database

    I want to develop an desktop app to save and retrieve details from database, but am having a little hitch
    am getting errors in my code, kindly advice below are the required code
    xaml
    <Grid>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,28,0,0" TextWrapping="Wrap" x:Name="TbxId" VerticalAlignment="Top" Width="193"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,134,0,0" TextWrapping="Wrap" x:Name="TbxFn" VerticalAlignment="Top" Width="193"/>
            <TextBox HorizontalAlignment="Left" Height="23" Margin="144,77,0,0" TextWrapping="Wrap" x:Name="TbxLn" VerticalAlignment="Top" Width="193"/>
            <Label Content="Student ID" HorizontalAlignment="Left" Margin="10,28,0,0" VerticalAlignment="Top" Width="101"/>
            <Label Content="Last Name" HorizontalAlignment="Left" Margin="10,134,0,0" VerticalAlignment="Top" Width="101"/>
            <Label Content="First Name" HorizontalAlignment="Left" Margin="10,77,0,0" VerticalAlignment="Top" Width="101"/>
            <Button x:Name="BtnSave" Content="Save" HorizontalAlignment="Left" Margin="23,206,0,0" VerticalAlignment="Top" Width="75" />
            <Button x:Name="BtnBrowse" Content="Browse" HorizontalAlignment="Left" Margin="149,206,0,0" VerticalAlignment="Top" Width="75" Click="Save"/>
            <Button x:Name="BtnShow" Content="Show" HorizontalAlignment="Left" Margin="294,206,0,0" VerticalAlignment="Top" Width="75"/>
            <WindowsFormsHost Grid.Column="0" Margin="448,28,75,243">
                <wf:PictureBox x:Name="pictureBox1" Height="150" Width="150" SizeMode="StretchImage"/>
            </WindowsFormsHost>
        </Grid>
    cs
    private void Browse(object sender, RoutedEventArgs e)
                SqlConnection cn = SqlConnection(global::DatabaseApp.Properties.Settings.Default.Database1ConnectionString);
                try
                    OpenFileDialog dlg = new OpenFileDialog();
                    dlg.Filter = "JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif|All Files(*.*)|*.*";
                    dlg.Title = "Select Student Picture";
                    if (dlg.ShowDialog() == DialogResult.OK)
                        imgLoc = dlg.FileName.ToString();
                        picStu.ImageLocation = imgLoc;
                catch(Exception ex)
                    System.Windows.MessageBox.Show(ex.Message);
    Thank you
    Jayjay john

    Hi Joakins,
    I think Lloyd has a point here in that all I see there which is really database related is a connection string.
    Maybe your question is more general though and you're just asking how to work with a database as a general principle.
    Personally, I like entity framework and would recommend that.
    You can read a shed load of stuff about it.
    https://msdn.microsoft.com/en-gb/data/ef.aspx?f=255&MSPPError=-2147217396
    With WPF almost every dev uses MVVM and I'm no exception.
    You may find this interesting:
    http://social.technet.microsoft.com/wiki/contents/articles/28209.wpf-entity-framework-mvvm-walk-through-1.aspx
    The article for the second in the series is only partly written, but the sample is complete:
    https://gallery.technet.microsoft.com/WPF-Entity-Framework-MVVM-78cdc204
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Unable to insert and retrieve Unicode data using Microsoft OLE DB Provider

    Hi,
    I have an ASP.NET web application that uses OLEDB connection to Oracle database.
    Database: Oracle 11g
    Provider: MSDAORA
    ConnectionString: "Provider=MSDAORA;Data Source=localhost;User ID=system; Password=oracle;*convertNcharLiterals*=true;"
    When I use SQL Develeoper client and add convertNcharLiterals=true; in sqldeveloper.conf then I am able to store and retrieve Unicode data.
    The character sets are as follows:
    Database character set is: WE8MSWIN1252
    National Language character set: AL16UTF16
    Select * from nls_database_parameters where parameter in ('NLS_CHARACTERSET','NLS_LENGTH_SEMANTICS','NLS_NCHAR_CHARACTERSET');
    PARAMETER VALUE ---------------------------------------
    NLS_CHARACTERSET WE8MSWIN1252
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    I have a test table:
    desc TestingUni
    Name Null Type
    UNI1 VARCHAR2(20)
    UNI2 VARCHAR2(20)
    UNI3 NVARCHAR2(20)
    I execute the below mentioned query from a System.OleDb.OleDbCommand object.
    Insert into TestingUni(UNI3 ) values(N'汉语漢語');
    BUT when retrieving the same I get question marks (¿¿¿¿) instead of the Chinese characters (汉语漢語)
    Is there any way to add the above property(convertNcharLiterals) when querying the Oracle database from OLEDB connection?
    OR is there any other provider for Oracle which would help me solve my problem?
    OR any other help regarding this?
    Thanks

    using OraOLEDB Provider.
    set the environment variable ORA_NCHAR_LITERAL_REPLACE to TRUE. Doing so transparently replaces the n' internally and preserves the text literal for SQL processing.
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements003.htm#i42617

  • Connect to FTP site with Apache commons net FTP client through Proxy

    Hello,
    I am trying to run this simple code to connect to FTP site through a proxy.
    import org.apache.commons.net.ftp.FTP;
    import org.apache.commons.net.ftp.FTPClient;
    public class MyTest {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    System.setProperty("socksProxyHost" ,"10.148.0.131");
    System.setProperty("socksProxyPort", "1080");
    FTPClient ftpClient = new FTPClient();
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    boolean successLogin = ftpClient.login(ftpUserName, ftpPassword);
    if(successLogin)
    System.out.println("success login");
    else
    System.out.println("fail login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("loging out");
    ftpClient.logout();
    System.out.println("disconecting");
    ftpClient.disconnect();
    catch (Exception e) {
    e.printStackTrace();
    I am getting the following error:
    C:\temp\ftp\test>java.exe -cp ./commons-net-ftp-2.0.jar;. MyTest connecting
    java.net.SocketException: Malformed reply from SOCKS server
    at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
    at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:265)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:437)
    at java.net.Socket.connect(Socket.java:519)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:176)
    at MyTest.main(MyTest.java:23)
    loging out
    java.lang.NullPointerException
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:471<ftp://FTP.java:471>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:534<ftp://FTP.java:534>)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:583<ftp://FTP.java:583>)
    at org.apache.commons.net.ftp.FTP.quit(FTP.java:794<ftp://FTP.java:794>)
    at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:697)
    at MyTest.main(MyTest.java:39)
    I am able to do this using a different FTP client library, ftp4j-1.5.1<ftp://ftp4j-1.5.1> using the following code:
    import it.sauronsoftware.ftp4j.FTPClient;
    import it.sauronsoftware.ftp4j.connectors.SOCKS4Connector;
    public class MyTestFtp4J {
    public static void main(String[] args) {
    String ftpHostName = "ftp.xxx.com";
    int ftpPort = 21;
    String ftpUserName = "myUserName";
    String ftpPassword = "myPassword";
    FTPClient ftpClient = new FTPClient();
    ftpClient.setConnector(new SOCKS4Connector("10.148.0.131", 1080));
    try {
    System.out.println("connecting");
    ftpClient.connect(ftpHostName, ftpPort);
    System.out.println("connected");
    System.out.println("loging in");
    ftpClient.login(ftpUserName, ftpPassword);
    System.out.println("success login");
    catch (Exception e) {
    e.printStackTrace();
    finally {
    try {
    System.out.println("disconecting");
    ftpClient.disconnect(true);
    catch (Exception e) {
    e.printStackTrace();
    So I know the proxy settings are correct.
    The java version I used to compile and run my apps is 1.6.0_06 Does anyone can help figure out what is wrong when I use the Apache commons net FTP client?
    Thank you
    Jon

    Is the old AirPort Extreme base station (AEBS)
    configured so that the option to distribute IP
    addresses is DISABLED? If so, configure the new AEBS
    to act as a bridge.
    Are you suggesting I use a set-up with TWO AEBSs? Set up a bridge (not sure how) and then use the old AEBS to connect to the DSL modem and broadcast to the new Extreme which will then be the router to the other computers on the network?
    Do you have any port mapping or default host enabled
    on the old AEBS?
    I do not understand, not do I see these options in the Base Station utitlity; perhaps they are in the FTP options--but that, I'm sorry to say, is not obvious to my inspection.
    Duane, can you give me a few more basic instructions? Thanks
    iMac 17    

  • Call C# method from javascript in WebView and retrieve the return value

    The issue I am facing is the following :
    I want to call a C# method from the javascript in my WebView and get the result of this call in my javascript.
    In an WPF Desktop application, it would not be an issue because a WebBrowser
    (the equivalent of a webView) has a property ObjectForScripting to which we can assign a C# object containg the methods we want to call from the javascript.
    In an Windows Store Application, it is slightly different because the WebView
    only contains an event ScriptNotify to which we can subscribe like in the example below :
    void MainPage_Loaded(object sender, RoutedEventArgs e)
    this.webView.ScriptNotify += webView_ScriptNotify;
    When the event ScriptNotify is raised by calling window.external.notify(parameter), the method webView_ScriptNotify is called with the parameter sent by the javascript :
    function CallCSharp() {
    var returnValue;
    window.external.notify(parameter);
    return returnValue;
    private async void webView_ScriptNotify(object sender, NotifyEventArgs e)
    var parameter = e.Value;
    var result = DoSomerthing(parameter);
    The issue is that the javascript only raise the event and doesn't wait for a return value or even for the end of the execution of webView_ScriptNotify().
    A solution to this issue would be call a javascript function from the webView_ScriptNotify() to store the return value in a variable in the javascript and retrieve it after.
    private async void webView_ScriptNotify(object sender, NotifyEventArgs e)
    var parameter = e.Value;
    var result = ReturnResult();
    await this.webView.InvokeScriptAsync("CSharpCallResult", new string[] { result });
    var result;
    function CallCSharp() {
    window.external.notify(parameter);
    return result;
    function CSharpCallResult(parameter){
    result = parameter;
    However this does not work correctly because the call to the CSharpResult function from the C# happens after the javascript has finished to execute the CallCSharp function. Indeed the
    window.external.notify does not wait for the C# to finish to execute.
    Do you have any solution to solve this issue ? It is quite strange that in a Window Store App it is not possible to get the return value of a call to a C# method from the javascript whereas it is not an issue in a WPF application.

    I am not very familiar with the completion pattern and I could not find many things about it on Google, what is the principle? Unfortunately your solution of splitting my JS function does not work in my case. In my example my  CallCSharp
    function is called by another function which provides the parameter and needs the return value to directly use it. This function which called
    CallCSharp will always execute before an InvokeScriptAsync call a second function. Furthermore, the content of my WebView is used in a cross platforms context so actually my
    CallCSharp function more look like the code below.
    function CallCSharp() {
    if (isAndroid()) {
    //mechanism to call C# method from js in Android
    //return the result of call to C# method
    } else if (isWindowsStoreApp()) {
    window.external.notify(parameter);
    // should return the result of call to C# method
    } else {
    In android, the mechanism in the webView allows to return the value of the call to a C# method, in a WPF application also. But I can't figure why for a Windows Store App we don't have this possibility.

Maybe you are looking for

  • RAM for people in Ontario, Canada

    Hey, Just wanted to let you know this RAM: http://www.canadacomputers.com/index.php?do=ShowProduct&cmd=pd&pid=009682&cid=RA M.187 works GREAT on the MacBook. It's the cheapest I can find in these neck of the woods. I installed two gig's and it's noti

  • No Clearing document in FCKR

    Gurus, I was able to successfully create a cleared check via FCKR. The is marked as paid in my check register. However, it's not posting a clearing document automatically. It's creating a session with session name that I give-ERR and I have to execut

  • Usb-8451 i2c developement

    Generated a simple program to talk to i2c on NSE5310 using usb-8451.  I get the following error. Error -301742 occurred at NI-845x I2C Write Read.vi:1 Possible reason(s): NI-845x:  The slave did not acknowledge an address+direction byte transmitted b

  • HT3574 If my iphone already connected to a wifi network like my home network, can I use internet tethering without using my limited data?

    I don't want an answer like "Google it" or to have take an Hour drive to the Apple store for this question. Considering when you are connected to Wi-Fi, your data does not get spent when you use the internet on your phone. Can I run the Connection fr

  • "Mail can't verify the identity of" after 10.6.4 update.

    So our Exchange 2003 server uses a wildcard certificate so we can protect multiple resources without buying 10 different SSL certs. It's been working perfectly so far, until I updated to 10.6.4. Now I get the following error. I've even deleted the ac