Creating a directory explorer in JSP

Hi,
I need to create a directory explorer in my JSP. Basically there are a set of directories and files. I have to show them in a tree view. If new directories/files are created, then the JSP view should get updated dynamically.
I know this amount of java IO is not very efficient, but my client has unique requitements. If someone knows of an easy way to do this, please let me know how.
thanks

Use yahoo TreeView widget library. It's not complex. Check at yahoo UI library. I have used this. Basically get the request data in a arraylist or hashtable and set it in the session. Then in your jsp get it and loop it to create the tree structure.

Similar Messages

  • Creating a directory via a jsp page sql query return

    Is it possible to create a directory based on the results of a sql query?
    i.e.
    My sql query returns application number 1234 for a building application (BC for short).
    Is it possible to create a directory /BC/1234
    It is then proposed to use an iframe to look into the directory so users can place and access scanned documents which are captured during the approval process.
    If so how?
    An example would be great.
    Jason

    Sorry hope your still around I've been away for a while. We've created a samber share to the file server where the documents are stored and mounted it within the web file directory. It works ok if there is an existing directory but if there isn't we want it to be created when the page looks for the folder. I've done this with an asp page it basically did a directory exist test first then create folder if it didn't. The problem is can't find an example of how to do the directory exist test then directory create syntax so an example of both would be great

  • Creating a directory in JSP?

    Is it possible to create a directory on the webserver using JSP?
    I basically have different users that login to the website, and at one point, they can upload certain files. I would like to put the files they upload in directories specific to each user.
    For example, user1 will have a directory in the web app called uploads/user1/ , while user2 will have a dir called uploads/user2/ , etc...
    Thanks.
    PS: I'm using jakarta commons fileupload to upload the files. I tried changing the upload target to a non-existent directory in hopes that it will just create it, but it didn't. :(

    As long as you have write permission on the server, you should be able to create directories as well as files.
    Just use the standard java.io package.
    File dir = new File("uploads/user1");
    dir.mkdirs();I don't know if you would want to store these uploads under your web app, or some other place on disk (presumably configured with a property) thats up to you.
    The ServletContext.getRealPath() method is useful for storing it relative to your web application.

  • I have a created a directory structure ias\ias-samples\myapps\src\docroot.In docroot folder i have a single jsp.i created a war file having that jsp,and ear file having the war file

    I deployed the ear file.Now i try calling http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?

    Hi,
    This is right provided you have installed the webserver & app server
    on the same machine and the port number for the web server is 80 by
    default.
    Regards
    Raj
    Arif Khan wrote:
    I have a created a directory structure
    ias\ias-samples\myapps\src\docroot.In docroot folder i have a single
    jsp.i created a war file having that jsp,and ear file having the war
    file
    I deployed the ear file.Now i try calling
    http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • How to create a directory in JSP

    I want to create a subdirectory in the server side by running a JavaServer Page. I don't know if it is possible. Can anybody tell me how to do that? thanks.

    Thanks for your message. I was thinking the same way. However, I think the user should logon the remote server first, then create a directory over there. Otherwise, who will own that directory?
    Here bring up another question. How can I logon a remote server in JSP?
    Can anybody help me? Thanks.

  • Creating A Directory

    In the tutorial "Building An Appliction", it states that the first step is:
    "Create a directory called divelog.
    Under the divelog directory, create another directory called images.
    For the Windows platform:
    C:\divelog\images".
    My question is, how do I create a directory? My experience in programing is zero. I've only worked with HTML, so please excuse my ignorance on such a simple task!

    I'm not sure it's this, but i think the tutorial means that you have to create the files using windows explorer and not using a programming language. Open WE and try it
    TS

  • Create OS directory and write file from BLOB

    Hi,
    i want to create via a stored PL/SQL procedure a directory in an OS filesystem (Windows NTFS) and afterwards write a file (Type: DOC, PDF, ...) from a BLOB table to that directory.
    The filesystem is one to the node (where the database instance 10g is running) mapped fileserver directory.
    The complete environment is Windows XP (node of the database instance and the mapped fileserver directory).
    Maybe i have to use a Java stored procedure - if yes, where can i find an appropriate example and documentation?
    Has somebody an idea how to achieve this?
    Many thanks in advance.
    Best regards,
    Martin

    You can find lot of java stored procedures samples here
    http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html
    And java code to create a directory is here.
    http://javaalmanac.com/egs/java.io/CreateDir.html

  • Creating virtual directory with OC4J

    Hello, all.
    I thought this issue was going to be straight-forward, but after searching this forum and the General one I am not so sure.
    Can someone tell me how to create virtual directory mappings or contexts for 10gAS so that jsps that reside in an remote directory (not under OAS_HOME) can be run through OC4J? The remote directory is already defined as a virtual directory in Apache and a servlet some of the pages hit is also deployed in OC4J.
    I read that you should be able to use OEM to update either the global-web-application.xml file or the orion-web.xml file, but I am unsure as to whether you create the virtual directories for the dms or webapp applications? I need the virtual directory to be available to more than one particular app.
    Thanks for any help,
    Dixie.

    I don't know if one can use the apache virtual directory in oc4j, however, you can archive the same effect by using the
      <virtual-directory real-path="pathRelativeToContextRoot" virtual-path="realPath" />
    element in orion-web.xml. Please see the doc at
      http://download-west.oracle.com/docs/cd/B10464_05/web.904/b10321/confdesc.htm#1019473
    which is Oracle Application Server Containers for J2EE Servlet Developer's Guide, chapter 6 Configuration File Descriptions, Element Descriptions for global-web-application.xml and orion-web.xml
    I believe you jsps will work if put in the virtual directory.

  • Windows Backup creates "locked" directory on SMB share

    I'm trying to back up my Windows 7 laptop to my Mac Mini over SMB.
    Normal non-backup file operations work okay, from the desktop: I can create folders, drag files, delete files, etc.
    But Windows Backup fails, because it creates a directory on the SMB share that--despite ACLs--OS X won't let anyone create files within, or change the security settings. The only option is to rm -rf the directory.
    The ACLs look like this (the directory Windows Backup creates is called 'MEGALITH'. I tried creating a parent directory (called 'Megalith') with inherited ACLs, but to no avail:
    sarsen:Megalith root# ls -le .
    total 0
    drwx------+ 2 windowsbackupuser  staff  68 Jan  8 12:49 MEGALITH
    0: user:root inherited allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,re adextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_i nherit
    1: group:admin inherited allow list,add_file,search,delete,add_subdirectory,delete_child,readattr,writeattr,re adextattr,writeextattr,readsecurity,writesecurity,chown,file_inherit,directory_i nherit
    2: user:_spotlight inherited allow list,search,file_inherit,directory_inherit
    Even with these ACLs, I cannot chown the MEGALITH directory. Nor can I edit its ACLs in the Server window.
    My SMB config is:
    sarsen$ defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.serve r
        AclsEnabled = 1;
        AllowGuestAccess = 0;
        AllowNTLM2Auth = 1;
        DOSCodePage = 437;
        EnabledServices =     (
            disk
        LocalKerberosRealm = "LKDC:SHA1.C5D430A59786EE0CC0515EEF37A77A538C6D612A";
        NetBIOSName = sarsen;
        ServerDescription = sarsen;
        Workgroup = WORKGROUP;
        "wins server" =     (
    And the error log says:
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request: init request
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request: init return domain: SARSEN server: SARSEN
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request: uid=0
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request: od failed with 2 proto=ntlmv1-with-v2-session
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request: user=SARSEN\\windowsbackupuser
    Jan 8 12:49:27 sarsen.nerdgod.com digest-service[711]: digest-request kdc: ok user=SARSEN\\windowsbackupuser proto=ntlmv1 flags: NEG_KEYEX, ENC_128, NEG_VERSION, NEG_TARGET_INFO, NEG_NTLM2, NEG_ALWAYS_SIGN, NEG_NTLM, NEG_SIGN, NEG_TARGET, NEG_UNICODE

    For interoperability with Windows clients, this is absolutely 100% bad behavior:
    http://support.microsoft.com/kb/326549
    Note Unlike the Read-only attribute for a file, the Read-only attribute for a folder is typically ignored by Windows, Windows components and accessories, and other programs. For example, you can delete, rename, and change a folder with the Read-only attribute by using Windows Explorer.
    The Read-only and System attributes is only used by Windows Explorer to determine whether the folder is a special folder, such as a system folder that has its view customized by Windows (for example, My Documents, Favorites, Fonts, Downloaded Program Files), or a folder that you customized by using the Customize tab of the folder's Properties dialog box. As a result, Windows Explorer does not allow you to view or change the Read-only or System attributes of folders. When a folder has the Read-Only attribute set it causes Explorer to request the Desktop.ini of that folder to see if any special folder settings need to be set. It has been seen where if a network share that has a large amount of folders set to Read-only, it can cause Explorer to take longer then what is expected to render the contents of that share while it waits on the retrieval of the Desktop.ini files. The slower the network connectivity to the share the longer this process can take to the point where Explorer may timeout waiting for the data and render nothing or appear to hang.
    Note In some previous versions of Windows, you can change the Read-only attribute for folders by using the Properties dialog box for the folder, but no versions of Windows permit you to change the System attribute by using Windows Explorer.

  • How Create Virtual Directory On Oracle Application Server 10g on RHEL 5

    Dear Sir
    i have deployed my application on OAS 10g on RHEL 5 ,,now since my application is calling some pro*c programs and then they generate some text based reports on fixed folder named
    /treas/temp
    now i simply have to open these text based reports on web browser
    WEB.SHOW_DOCUMENT('/forms/pcreport/'||v_filename);
    but for that i need to create virtual directory name : " /pcreport " without code
    kindlly help as its working on my developer suit 10g i created a virtual directory in my application server by making following entry in "orion-web.xml" file
    <virtual-directory virtual-path="/pcreport" real-path="/u/treas/temp" />
    kindlly help

    (My paths shown, yours will be different)
    In a text editor :
    /u01/app/oracle/product/midtier/Apache/Apache/conf/httpd.conf
    Add
    Alias /pcreport/ "/u01/app/oracle/product/midtier/forms/pcreport/"
    <Directory "/u01/app/oracle/product/midtier/forms/pcreport/">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
    Create the pcreport directory.
    Add a simple test page
    vi /u01/app/oracle/product/midtier/forms/pcreport/test.html
    <html>
    <head>
    <title>Simple test page </title>
    <style type="text/css">
    body {
    margin-left: 20%;;
    margin-right: 20%;
    border: 1px dotted gray;
    padding: 10px 10px 10px 10px;
    </style>
    </head>
    <body>
    <p>test!</p>
    </body>
    </html>
    Test
    http://yourserver.com:7777/pcreport/test.html
    Best Regards
    mseberg

  • Creating a directory on a remote machine using a UNC path

    Hi all,
    Is it possible to create a directory on a remote machine using a UNC path such as \\Server\Share\Directory?
    If so, how would i go about this? (Sorry for the newbie question, that's exactly what I am!)
    Thanks,
    Rob

    The tables on your pages are images. Not very convenient if the visitor wants to copy the information and use it.
    Read this how to use tables :
    http://www.wyodor.net/blog/archives/2010/01/entry_297.html
    http://www.wyodor.net/blog/archives/2010/01/entry_298.html
    Samples :
    http://www.wyodor.net/mfi/Maaskant/Seabreeze.html
    http://www.wyodor.net/mfi/Maaskant/Experiment.html
    http://www.wyodor.net/mfi/roodhout/Prices.html
    And here's a non-iWeb page with a sortable table :
    http://www.wyodor.net/htmlegg/TallCard/TallAjax.html?pg=tablesorter
    Or use a database on the server with MySQL and make tables with PHP :
    http://www.google.com/search?q=create+html+table+with+data+from+mysql+database
    Here's a very simple way to do it :
    http://home.wyodor.net/w3school

  • How can I create a directory on my server using FTP in applescript?

    Hi
    I have created a script which successfully uploads files to my server using FTP and a curl command.
    The one thing I haven't worked out how to do is how to create a directory on my server using applescript. At the moment I have to manually create the correct directory for the script to work, but would like to be able to automate everything.
    Would this be possible?
    Thanks
    Nick

    Thanks Bernard.
    I have tried that and still get the error message:
    "curl: Can't open '--ftp-create-dirs'!
    curl: try 'curl --help' or 'curl --manual' for more information
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
    curl: (9) Server denied you to change to the given directory"
    The other relevant parts of the script are:
    set ftp_url to "ftp.****.org.uk/artists/" & artistName2 & "/assets/"
    set ftp_username to "*****@*****.org.uk"
    set ftp_password to "****"
    set ftp_entire to ftp_username & ":" & ftp_password & " ftp://" & ftp_url
    set outPath to outputFolder & fileCounter & ".jpg"
    and then...
    do shell script ("curl -T --ftp-create-dirs " & outPath & " -u " & ftp_entire)
    Like I said, all works fine when the directories are already in place. I have permissions for the artists folder set to "777", i.e. writable. Because the script is trying to create two directories at once, i.e. "artistName2" and then "assets" under it, I wondered if this was significant, but then I tried with just one new directory, and still got the error.

  • Error in creating a directory

    Hi,
    I'm trying to create directory using sql command in apex. But it is throwing an error as 'Insufficient privileges'
    So whom I have to ask for privilege to create a directory?
    Thanks,
    Anoo..

    Good morning Anoo,
    You should check with your DBA to make sure that APEX_PUBLIC_USER has create directory rights.
    Don.
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! :)

  • Error creating a directory while downloading

    I installed this the first time fine, but it wouldn't recognize my itouch, so i uninstalled all of apples programs from my computer and reinstalled, then got the error:
    "An error occurred while attempting to create the directory: C:\Program Files\Common Files\Apple\Mobile Device Support\in\AppleMobileDeviceHelper.app"
    When I continue past this by canceling, i get similar errors with different variations under the program file directory writing, and when i try to install a previous version, I get this as well.
    Any help/ideas would be great.
    Message was edited by: Verrexis

    Same exact problem for me. Reported it 9/24/09. Have not tried deleting the fonts. May try it if I'm not using them for something else. This is rediculious. There's a million reports of this problem out there with all sorts of Operating Systems and no one will fix it.

  • Error when trying to create a directory in ASM

    Hello,
    I've got Oracle RAC 11gR2. Two nodes with Windows Server 2008. Database in ASM instance.
    I'm trying to create a directory "backupp" in ASM instance, but got error.
    All Oracle Windows services are running under Local Ssystem Account.
    I've logged in Windows Server 2008 with user AdminRAC, which is membor of Administrators and ORA_DBA Windows group.
    Diskgroup: data
    C:> SET ORACLE_HOME=C:\app\11.2.0\grid
    C:\>SET ORACLE_SID=+ASM1
    C:\asmcmd
    Connected to an idle instance.
    ASMCMD> mkdir +data/backupp
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    ORA-15032: not all alterations performed
    ORA-15005: name "+data/backupp" is already used by an existing alias (DBD ERROR:
    OCIStmtExecute)
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    ASMCMD>

    user521219 wrote:
    Hello,
    I've got Oracle RAC 11gR2. Two nodes with Windows Server 2008. Database in ASM instance.
    I'm trying to create a directory "backupp" in ASM instance, but got error.
    All Oracle Windows services are running under Local Ssystem Account.
    I've logged in Windows Server 2008 with user AdminRAC, which is membor of Administrators and ORA_DBA Windows group.
    Diskgroup: data
    C:> SET ORACLE_HOME=C:\app\11.2.0\grid
    C:\>SET ORACLE_SID=+ASM1
    C:\asmcmd
    Connected to an idle instance.
    ASMCMD> mkdir +data/backupp
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for append
    CLSU-00100: Operating System function: open failed failed with error data: 2
    CLSU-00101: Operating System error message: The system cannot find the file spec
    ified.
    CLSU-00103: error location: SlfFopen1
    looks like two different problems exist
    ORA-15032: not all alterations performed
    ORA-15005: name "+data/backupp" is already used by an existing alias (DBD ERROR:
    OCIStmtExecute)directory already exists
    Can't open 'C:\app\11.2.0\grid/log/diag/asmcmd/user_AdminRAC/JNESRVRACA/alert/al
    ert.log' for appenderror can't be logged

Maybe you are looking for