Read a directory on the clients box

All,
I have written some code that when you make a pick in the web browser I want it to give you a list of files in a directory on your computer.
File current_dir = new File("e:\\pro_work\\.proi");
String file_list[] = current_dir.list();
This is a piece of the code I use and it seems to work fine when I am testing the application on my own box. When I go over to another persons machine and try it . I get the directory listing of my computer. I am using Netbeans as the server until I get it finished and deploy it. Any help on how Ithe client would see the list of iles on there machine would be appreciated. Thanks

No, you can't access the client computer with java code.
Java runs on the server. Thats why they call it Java Server Pages.
You would need an applet/activex control to access the client computer's file system.

Similar Messages

  • How to make a Java application that will change the client box's IP address

    HI how to make a Java application( that application would be run on the client ) that will change the client box's IP address ( IP address of itself )

    If you can do that through the command line, then use Runtime.getRuntime().exec(...) to execute your command.

  • I want to read a file on the client side

    Hi all,
    I want to read a file on the client side, then the server show the contents of that file.

    Signed applet sounds cool - I guess Microsoft's ActiveX technology would be the mirror of this.
    Write you file access code as you normally would and then just drop it in a applet and JAR it up.
    Use keytool to sign it - users will be requested to accept/review your certificate in order to grant file-access permissions.
    Warm regards.

  • Reading file names in the unix box

    Hello,
    I did the following to read the files from the local directory.
    String s1 = "c:\samplefiles"
    File dir = new File(s1);
    if(dir.isDirectory())
    String listoffiles [] = dir.list();
    for(int i = 0; i <listoffiles.length ; i++)
    System.out.println(listoffiles);
    else
    System.out.println("Its not a directory");
    How can i read and print the file names in the unix box?
    Thank You.
    Kumar

    Thank You for the reply.
    In my custom page, i am trying to include a search page which includes date parameters based on which the pdf files in the unix box should be displayed in the page as a list. (The pdf file names start with the date).
    Once the user clicks the file names displayed in the page, i need to open the pdf. This part i can handle but to search the file names based on the parameter names and display in the page as the list is a bit confusing.
    Thank You.

  • REP-50159 - when report sent directory on the linux Box

    We have created a directory called hbc_parvo and the path is /u01/hbc_parvo. Added path in reports.sh and restarted reports server.
    I am trying to run the report and save on the Linux Box in the directory I created.
    I get this error when I run the report
    REP-50159: Executed successfully but there were some errors when distribute the output. Need help if anyone has had the same error and how to fix it
    Edited by: user11244023 on Jul 13, 2010 1:20 PM

    Hello,
    There are 2 steps in a Reports execution with the Reports Server :
    Step 1 : The reports is exeucted by a reports engine and the Reports output is generated in the Reports Server cache.
    Step 2 : The reports server will take the output generated in the cache by the engine and will send it to the destination specified in the parameter (DESTYPE DESNAME)
    In your case, a problem occured during the Step 2
    What is the DESTYPE / DESNAME used ?
    Regards

  • Read System Information from the Client

    Hi,
    i am looking for a java native interface that allows me to read the client's system information like it can be done with the sigar lib.
    http://support.hyperic.com/confluence/display/SIGAR/Home
    Does anyone know if there are alternative native libraries available?!
    Thanks in advance,
    Patrick

    I'm doing exactly the same in both projects.The OS loads the library into the process space.
    You know it works in java. Thus it means specifically that it is an environment problem. It is not a java problem and it is not a library problem.
    The problem is that the library fails to load.
    General reasons for loading failures. There might be others.
    - It isn't a library. Can't be this because you got it to work already.
    - It has dependencies, other libraries, that don't exist or are not in the shared library path.
    - It isn't in fact the same as the other webstart app. Different location, different coniguration, permissions problem, something else.

  • I cannot read e-mail because the in-box refreshes constantly

    When i open a email the message displays briefly then goes back to the in-box. And the system is constantly checking for new e-mails.

    Please update to Firefox 22 getfirefox.com and clear cache etc .
    * [[How to clear the Firefox cache]]

  • How to transmit 70 channels of field point data that i am reading in fp2000 to the client

    i want know to what are the ways to do it,please send me some examples on how to do it.(datasocket,fp publish)

    Check out these links. I hope that they help!
    Fieldpoint and RT
    Logging Data with a FieldPoint FP-20xx to View in a Web Browser
    Transferring Files from a FieldPoint FP-20xx through an FTP Server
    Introduction to Using DataSocket Commands to Communicate with FieldPoint Etherne
    t Network Modules
    Good Luck!
    Mike
    NI

  • Now that I have the Media server and 3 media client boxes, all

    Now that I have the Media server and 3 media client boxes, all the individual lists of schedules are gone.
    Is there any way to keep the seperate lists on the client boxes?
    Solved!
    Go to Solution.

    No because the VMS is where are all the recordings are done.
    Client boxes use the tuners of the VMS.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Open/read a txt file on the client side in a Form server architecture

    We are moving our software from client-server to Web architecture but we have problems
    with all the forms that use GET_FILE_NAME and
    TEXT_IO built-in functions.
    This commands, in fact, work on the application-server side and not on the client (browser-side) as we need.
    How can we solve this problem??????
    Thank-you for your help.
    null

    there is a way to solve this problem.
    you must use developer 6 and above.
    you will have to modify your appliaction and use developer ability to work with javabeans
    you will have to write a javabean that will do the read/write operation at the client side.
    for more details look at my answer to the following topic:
    "Read and Write Files to user from FormsServer "
    that was opened at dec 15.
    Yossi

  • Listing contents of the client's CD/flash/hard drive

    Hi,
    I am new to Coldfusion and am having trouble doing the
    following: When the users click on a button, all the folders on a
    CD drive or on a USB drive, should be parsed automatically, and
    whichever folders contain the .ini file type, all the files from
    that folder should be automatically uploaded to the server.
    Is there any way to do this? I read about the CFDirectory
    tag, but i think it is used to list all directories on the
    coldfusion server. How can I parse the contents of a
    folder/directory on the client's machine (CD/USB drive)? Is there
    any other tag I should use?
    Any help is highly appreciated.
    Thanks

    Basically you can't. This is because of security
    But you can write/get an activeX control to do this, but it
    has to be allowed by the user.
    Ken

  • Question about using the Combo Box feature!

    I have a form that I am trying to create for our company that will allow our field nurses to select what they need and print it more effieciently.  The problem is that some of the selections are too long and I can't get the Combo box feature to allow them to be printed on multiple lines:
    I have spoken to my supervisor about redoing the form to look like this:
    But in order for us to meet state guidelines it has to be formated like the first because that is the state form given to us.  I want to be able to either:
    A) have the combo box multi-line auto text sized so it will get all the information into each box
    OR
    B) create text boxes at the end of the form that auto enteries the selected data from the second picture into boxes that look like the first picture.
    Is there any way to do either of these?

    A) No.
    B) Yes. Create a text box with the following code as the custom calculation
    script (assuming the name of the combo is "Combo Box1"):
    event.value = this.getField("Combo Box1").value;
    That way, when the user makes a selection in the combo-box, the value will
    also appear in the text box. Just make sure to make the text box read-only
    and set the combo-box to apply the selection immediately.

  • Viewing a directory in a list box

    Hi, I am new to java, so dont be to harsh.
    I am using J Builder 5.
    I wish to view a directory in a list box, when a button is pressed.
    The button should bring up a dialog box to accept user input.
    I have already created the frame and button, but I dont know how to
    get the button to display the directory in the list box.
    I would be grateful of any help.
    John.
    Here is my code so far:
    FRAME1.java
    ==========
    package coursework;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
    JPanel contentPane;
    BorderLayout borderLayout1 = new BorderLayout();
    JPanel jPanel1 = new JPanel();
    JPanel jPanel2 = new JPanel();
    JPanel jPanel3 = new JPanel();
    JPanel jPanel4 = new JPanel();
    private Button setdir, exit, notes, all, pics, movies, music;
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JButton jButton3 = new JButton();
    JButton jButton4 = new JButton();
    GridLayout gridLayout1 = new GridLayout();
    JButton jButton5 = new JButton();
    JButton jButton6 = new JButton();
    JButton jButton7 = new JButton();
    JTextArea jTextArea1 = new JTextArea();
    JScrollPane jScrollPane1 = new JScrollPane();
    /**Construct the frame*/
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    /**Component initialization*/
    private void jbInit() throws Exception {
    //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);
    this.setForeground(Color.lightGray);
    this.setSize(new Dimension(415, 350));
    this.setTitle("Media Catalogue");
    Button jbutton1 = all;
    Button jbutton2 = pics;
    Button jbutton3 = music;
    Button jbutton4 = movies;
    Button jbutton5 = exit;
    Button jbutton6 = setdir;
    Button jbutton7 = notes;
    jButton1.setMnemonic('0');
    jButton1.setText("All");
    jButton2.setText("Pictures");
    jButton3.setText("Music");
    jButton4.setText("Movies");
    jButton5.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton5_actionPerformed(e);
    jPanel2.setLayout(gridLayout1);
    gridLayout1.setRows(4);
    gridLayout1.setColumns(1);
    gridLayout1.setHgap(8);
    gridLayout1.setVgap(2);
    jButton5.setText("Exit");
    jButton6.setText("Set Root Directory");
    jButton7.setText("View Notes");
    jTextArea1.setBackground(UIManager.getColor("text"));
    jTextArea1.setText("Multi Media Catalogue");
    contentPane.add(jPanel2, BorderLayout.EAST);
    jPanel2.add(jButton4, null);
    jPanel2.add(jButton3, null);
    jPanel2.add(jButton2, null);
    jPanel2.add(jButton1, null);
    contentPane.add(jPanel3, BorderLayout.SOUTH);
    jPanel3.add(jButton5, null);
    jPanel3.add(jButton6, null);
    jPanel3.add(jButton7, null);
    contentPane.add(jPanel4, BorderLayout.WEST);
    contentPane.add(jPanel1, BorderLayout.NORTH);
    jPanel1.add(jTextArea1, null);
    contentPane.add(jScrollPane1, BorderLayout.CENTER);
    jButton6.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton6_actionPerformed(e);
    /**Overridden so we can exit when window is closed*/
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton5_actionPerformed(ActionEvent e) {
    System.exit(0);
    void jButton6_actionPerformed(ActionEvent e) {
    APPLICATION1.java
    =================
    package coursework;
    import javax.swing.UIManager;
    import java.awt.*;
    public class Application1 {
    boolean packFrame = false;
    /**Construct the application*/
    public Application1() {
    Frame1 frame = new Frame1();
    //Validate frames that have preset sizes
    //Pack frames that have useful preferred size info, e.g. from their layout
    if (packFrame) {
    frame.pack();
    else {
    frame.validate();
    //Center the window
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = frame.getSize();
    if (frameSize.height > screenSize.height) {
    frameSize.height = screenSize.height;
    if (frameSize.width > screenSize.width) {
    frameSize.width = screenSize.width;
    frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
    frame.setVisible(true);
    /**Main method*/
    public static void main(String[] args) {
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    catch(Exception e) {
    e.printStackTrace();
    new Application1();
    }

    I am not quite sure if this is what you are looking for, but I was doing stuff with listing directories a while ago, and this is how I did it.
    When the user changed directory on the GUI, I called a function called listDirectory(), which changed the contents of a JTable to be the details of the files in that directory, the following is the listDirectory function:
    private void listDirectory()
    File flDirectory = new File(strWorkingDir);
    ExtensionFilter udtAllowedFiles = new ExtensionFilter("*.*");
    udtAllowedFiles.setConstraints(ExtensionFilter.FILES_ONLY);
    String [] strListFiles = flDirectory.list(udtAllowedFiles);
    strDirContents = new String[strListFiles.length][3];
    Vector vctCheckedOutFiles = udtParent.getLockedFiles(strWorkingDir);
    for(int i=0; i<strListFiles.length; i++)
    /*add the file information to the strDirContents array*/
    jtlListing.setModel(new DefaultTableModel(
    strDirContents,
    new String [] {"Name", "Type", "Last Modified"}
    Note, the ExtensionFilter implements the class FilenameFilter.
    You should be able to use a JList instead of the JTable, if that is what you need.
    Any other questions, or if this doesn't answer your query, let me know,
    S

  • "We have consolidat​ed 2 of our MATRIXx licenses ver 6.2.2 & 7.0 onto a single server. Now I want to run them on the clients as well.How do I go about?

    Two different versions of MATRIXx licenses to be loaded & run on the clients as well??

    You will need a copy of the license.dat file on the client computer to use the floating licenses from a server. You can either copy the license.dat file from the server. Or you can create a proxy license file. A proxy license file is a two line file, where the first line is the first line from the server license file. The second line is USE_SERVER. For example
    SERVER host1 17003456 2700
    USE_SERVER
    If you are using redundant servers you will need one line for each server. For example
    SERVER host1 17003456 2700
    SERVER host2 17006789 2700
    SERVER host3 1700EF34 2700
    USE_SERVER
    The advantage of using a proxy license file is that if the licenses change on the server you do not need to update all the clients. In both cases you would place the license.dat
    in the ISILM directory of the client.
    Carl Ljungholm
    National Instruments

  • Hello, the 'Save As' dialog box used to allow the backspace button to go up one level in the directory when the focus is in the folder contents box but it does not work any more, please help.

    Hello, the 'Save As' dialog box used to allow the backspace button to go up one level in the directory when the focus is in the folder contents box but it does not work any more, please help. BTW the same 'Save As' dialog in other applications still allow the backspace button to go up one level in the directory.

    cor-el,
    I kept forgetting and procrastinating about following your instructions, since I have internet access only for limited amounts of time and usually I am busy with important tasks when I am.
    Out of the blue, the problem corrected itself (the Save As box started to open full screen, then shrunk down to a normal size and the edges can now be dragged to a custom size).
    Even the copy and paste problem in the filenaming area seems to have been less troublesome lately even though there have been no updates to Firefox in a few weeks.
    Even though I marked the solution as not helpful, the problem has in fact been resolved. I will save the solution instructions in case the issue returns.

Maybe you are looking for

  • E-Recruiting : Role Authorization in e-recruiting standalone scenario

    Hello Friends, We have EREC on a standalone system (ERD 100). HR ECC is another system (ECD 300), Enterprise portal in another system (EPD 100). we are on EHP 5, EREC 605, Support Pack 7. We have activated the single sign on mechanism. I have followi

  • Setting postScript is not working

    Hi, Am trying to set the postscript level 3 to the files using javascript. but it's not working. here is my code: saveoptions = new EPSSaveOptions; saveoptions.postScript = EPSPostScriptLevelEnum.LEVEL3; the above code is not working in adobe illustr

  • How to clear two dimension array and content in JTextArea

    hi all.... i have a problem to clear the counter in JTextArea..currently i design a program to store all the student details in two dimensian array...when i click "RESET"button..it will only reset the textarea..but can not clear the actual content in

  • Calculated Account by Entity but exlcude Parents

    I have an account in our outline (Calced Income Tax) which uses the following formula: If(@ISMBR("Actual")) "TAX"; Elseif(@ISMBR(@LIST("Budget","Q1RF","Q2RF","Q3RF","Q4RF"))) if(@ISMBR(@RELATIVE("Entity",0))) "Calced Earnings Before Income Tax"*"Corp

  • I wish to replace my iPhone 4

    So I have had a GSM iPhone 4 and I did purchase Apple Care, my iPhone has a small crack and a dent, and a few scratches on the metal surounding. I've had only one replacement because the lock for some reason was stuck. Anyways I wish to get it swappe