Listing a directory List
Hi All,
thankx for reading this.
I'm building a forms 6i user form that is suppose to load plenty of user files into a directory.
I would like to know how i can read a directory list into a variable(for example a record table)/temporary table, in order to allow me to then process each file in a batch form.
I can read and open a single, but i would really need to read a directory.
Any feedback, sample code or pointers would be great
Stay Happy
Miguel Angelo
Direcção-Geral do Orçamento
Can you provide an example of where that happens - the URL?
Similar Messages
-
Remote System Directory Listing/Navigation in JTree
Hi
I want my Remote System(Linux) directory listing to be available in a JTree. I need some help on implementing the same. Also How do i constantly get the directory structure of the remote system.
Thanks in Advancehttp://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
http://en.wikipedia.org/wiki/Model-view-controller
How you get the data depends on how you access the server. Maybe FTP. -
Very slow network directory listing - but fast data transfer speed once listed?
Hello,
I have really tried to sort this myself before opening up to the community, however I have run out of ideas, and hope someone can offer the magic solution I have missed.
I am currently using the 3.4ghz i7 iMac on a 1GB LAN, running OSX10.7.2 - connecting to a Windows Server 2008 (Running Release 2) over ethernet.
If i go to a network directory that i haven't recently accessed it can take up to 60 seconds to show the contents of that directory. Once i have accessed that folder, if i come out of it and go back in it will be instant again - but the first time it lists the directory it looks like i have opened an empty folder - which after anything from 10seconds to 1 minute will suddenly show the files that are there.
Internet connectivity is fast through the network, and file transfers across the LAN are fast. (showing as approx 300mb per second) I can play and edit HD content across the network with no slowdown so I am confident that this issue is not related to the network speed itself, and is more to do with a setting on this mac.
Symptoms are very similar to this post: https://discussions.apple.com/message/12245148?messageID=12245148&%3b#1224514 8 - however i understand that in OSX Lion - SMB was removed - so i cannot find this file to edit.
I have tried bypassing additional hubs in the network by wiring direct cables to the switch that is connected to the file server, this made no difference.
I have also tried disconnecting the ethernet cable, and running over wifi. This fixes the listing problem, but when editing HD content over a network drive, this connection is not fast enough to carry the data without interruption (some projects are linked to up to 900gb of hd video content!)
Using ethernet, I have tried DHCP, DHCP with manual address, and manual mode. All reproduce this problem. i have tried using the windows workgroup, and tried without it.
I have also followed this suggestion: https://discussions.apple.com/thread/2134936?threadID=2134936&tstart=45 and used OpenDNS. this did not fix the issue.
For argument sake, I have also just tested a Macbook Pro running Snow Leopard to see if it was OS related. This reproduces the exact same problem, near instant directory listing on the wifi, a long and arduous wait on ethernet.
I cannot work out why directory listing is instant over wifi, but not over ethernet on 2 different macs, running 2 different versions of OSX. I also do not understand why if the network is having trouble listing the directories - the data transfer speed is 300mbps when i copy files across the wired network from the file server to the mac.
Does anyone have any other ideas as to what could be the problem here? We are about to start work on a very large project, where the content we are editing is spread out across around 200 different network folders (different shoots captured over the past 2 years). We really don't have the time to wait 60 seconds each time we need to access one of those directories to look for a file, and I am very close to pulling all my hair out!
I really look forward to hearing from anyone who can offer any insight.If you are suspecting that the Windows update had something to do with your LAN going slow, then try the following:
1. Look for updates for your clients LAN NIC driver; or
2. Un-install the updates. -
Unable to list SFTP Directory on windows 2008 r2 server from internet
Hi experts,
I have configured a SFTP on windows 2008 r2 server. And i am using the Filezilla on client machine to connect to SFTP server.
The connection works properly on internal network but it displays error when i connect from internet.
Error: GnuTLS error -53: Error in the push function.
Response: 550 Data channel timed out.
Error: Failed to retrieve directory listing
This machine is publish with public IP and port22. The connection and authorization process gets complete but stops are Directory Listing.
PLease suggest the troublshooting steps..
Let me know if any more info is rquired.Hi,
Do you also use the Filezilla to configure SFTP server? Since you use Filezilla on client machine to connect to SFTP server, I would suggest you ask for help from Filezilla forums for better and accurate answer.
https://forum.filezilla-project.org/
Best Regards,
Mandy
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. -
Hello, I try to list a directory in a JSP file, but I get this when I try it: "[Ljava.lang.String;@8e4805"
My code is:
<%
String userPath=request.getRealPath("users/");
File f = new File(userPath);
String[] files = f.list();
for(int i=0; i<files.length; i++) {
out.println(files);
%>Hello, I try to list a directory in a JSP file, but I
get this when I try it: "[Ljava.lang.String;@8e4805"
My code is:
<%
String userPath=request.getRealPath("users/");
File f = new File(userPath);
String[] files = f.list();
for(int i=0; i<files.length; i++) {
out.println(files);
%>
That's cause out.println(files) will call the toString method of the String[], not the particular index you want to print. Try:
<%
String userPath=request.getRealPath("users/");
File f = new File(userPath);
String[] files = f.list();
for(int f=0; f<files.length; f++) {
out.println(files[f]);
%> -
How to apply style sheet (.css) in Weblogic directory listing
Hi,
We are migrating a directory listing application from Apache to Weblogic.
Earlier we did this by Apache httpd.conf entry like below :
<Directory "/opt/apache/httpd-2.1.9/htdocs/Myreportfolder">
IndexOptions FancyIndexing FoldersFirst NameWidth=* XHTML
IndexOrderDefault Descending Date
IndexStyleSheet "/css/style.css"
</Directory>
/opt/apache/httpd-2.1.9/htdocs folder has all it's usual resource files.
We were able to see documents in "Myreportfolder".
Now we have moved to Weblogic and using virtual directory mapping as below and we are trying to achieve the same thing:
<?xml version="1.0" encoding="UTF-8" ?>
- <wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
- <wls:container-descriptor>
<wls:index-directory-enabled>true</wls:index-directory-enabled>
<wls:index-directory-sort-by>LAST_MODIFIED</wls:index-directory-sort-by>
</wls:container-descriptor>
- <wls:virtual-directory-mapping>
<wls:local-path>/Myreportfolder</wls:local-path>
<wls:url-pattern>/*</wls:url-pattern>
</wls:virtual-directory-mapping>
<wls:context-root>/getreports</wls:context-root>
</wls:weblogic-web-app>
We are able to view the reports but we do not get look-and-feel of Apache like directory listing.
but we encounter below issues:
1) File/Folder icons are not visible - we want to use style sheets in http header from the response that is returned from weblogic server
2) Filename is limited to 29 characters when it is showing
3) Files are not sortable as Descending order - we sorted using tag <wls:index-directory-sort-by>LAST_MODIFIED</wls:index-directory-sort-by> but the latest file is shown at the last
We are thinking that Weblogic must be having some configuration like Apache httpd.conf where we can apply style sheets (css ).
We would appreciate af anyone can provide better insight into the issue.
or is it possible to extend weblogic.servlet.fileservlet class to serve this purpose.
Thanks & regards,
RabiHi Vikash,
Check the below links which will you idea on the same.
Stylesheet for WDA without integrating in SAP Portal
Apply custom css to WebDynpro application
Thanks
KH -
Question:
Trying to create a page that displays a directory list of a folder content.
Don't want to use the literature module...
Would like to create a folder where I easily can upload files (ftp) and create a menu link that displays the folder content as a list using my master template and css ...
The files in the list should be available for download.
Any suggestions on how to achieve this?
Answer:
This is not possible on BC. You can display a folder view and links to all the content in it. You'll have to upload your items and create a page with links to those items.That's a server message. Means what it says.
-
How do I populate an array with a directory listing.
I have a web site that has its photos updated by another person using a content management system that I have written. As Dreamweaver does not know about these extra photos, if I try to
syncronise the site on my machine for backup purposes, Dreamweaver downloads all 5000+ photos, and this can take upwards of 12 hours if there are no breaks in the connection.
So I am trying to write a page that creates an array of the existing files on the remote site. It will then do the same on my local site, and by comparing the arrays, will make a list of the new files, and then download these, which will save a lot of time and bandwith charges.
First I have to read the directory list, using the code below which reads and echos it on screen.
However, I cannot work out how to populate the required array.
<?php
try
{ /***photo directory ***/
$it = new directoryIterator('../web/thumbs');
while( $it->valid())
/*** echo if not a dot directory ***/
if( !$it->isDot() )
/**** Array creation code needs to go here I think.***/
echo $it->current()."<br />";
/*** move to the next element ***/
$it->next();
catch(Exception $e)
/*** echo the error message ***/
echo $e->getMessage();
?>
This creates a list of files and displays it on the page.
How do I store it in an array?
Howard WalkerAlthough not the solution you were looking for, consider the following:
Click the icon in DW for "Expand to show local and remote sites." Arrange the remote image directory by "Modified date," Then select all the recent images and GET them.
I find the above method good enough for occassional synchronization. I also simply ignore broken image links on the testing system.
If the above is not a solid enough solution, perhaps someone else will write your array function for you. I don't have the time. -
How to get a directory listing in XE?
So how would you best get a directory listing?
There was a lovely thread about using dbms_scheduler to make external calls:
Re: External procedure calls supported?
Which discussed how to run an external prcoedure. So using that technique would an approach be:
create procedure get_dir(p_dir varchar2)
--get sequence for directory call
--call 'synronous dbms_scheduler that executes "ls -l > /tmp/listing[sequence]
--create external table temp_dir_[sequence]
--load it into a global temp table ala ASKTOM http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584
--drop the external table
Someone on Asktom said they were going to do it via dbms_pipe but was not forthcoming with an example.
I'm not sure I like creating and dropping an external table every time this procedure is called and I feel I am missing a technique (or a good idea) to make this work effectively.
Kind Regards,
James
Got the link to the 'External procedure calls support' wrong.
Message was edited by: jcrockartOk.
Well here is the solution... Can I make it better?
FROM OS (oracle user):
vi ~/get_dir.sh
#!/bin/sh
ls $1 > /tmp/$2
exit 0
##end
FROM SYS:
create directory OS_TMP as '/tmp';
grant read,write on directory OS_TMP to hr;
grant create table to hr;
FROM HR:
create global temporary table DIR_LIST
( filename varchar2(255) )
on commit delete rows
--create the following:
CREATE OR REPLACE procedure get_dir_list (
p_directory in varchar2
IS
l_jobname VARCHAR2 (100);
BEGIN
l_jobname := DBMS_SCHEDULER.generate_job_name (prefix => 'get_dir_list');
dbms_output.put_line(l_jobname);
--dbms_output.put_line('ls '||p_directory||' > /tmp/blah');
--creat syncrhous job
DBMS_SCHEDULER.create_job (
job_name => l_jobname,
job_type => 'EXECUTABLE',
job_action => '/home/oracle/get_dir.sh',
number_of_arguments => 2,
enabled => FALSE,
comments => 'directory listing for '||p_directory);
DBMS_SCHEDULER.set_job_argument_value (l_jobname, 1, p_directory);
DBMS_SCHEDULER.set_job_argument_value (l_jobname, 2, l_jobname);
-- Run job synchronously.
DBMS_SCHEDULER.run_job (job_name => l_jobname, use_current_session => TRUE);
-- Remove job after run
DBMS_SCHEDULER.drop_job (l_jobname);
--create external table
execute immediate '
create table '||l_jobname||'_ext
file_name varchar2(1000)
organization external (
type oracle_loader
default directory os_tmp
access parameters (
records delimited by newline
fields terminated by '',''
missing field values are null
file_name)
location ('''||l_jobname||''')
reject limit unlimited';
execute immediate '
INSERT INTO DIR_LIST(FILENAME) select file_name from '||l_jobname||'_ext
END;
--test it
exec get_dir_list('/home/oracle')
GET_DIR_LIST14
PL/SQL procedure successfully completed.
hr>select * from dir_list;
FILENAME
apex
apex_3.0.1.zip
get_dir.sh
go.log
go.txt
test.sh
6 rows selected.
hr>
Apologies for butchering Dietmar Aust dbms_schedule example.
I can't drop the external table as the data in the global temporary table will be lost, so I will have to periodically clean up after this procedure.
Please somebody feel free to give me the one line solution ;-)
Regards,
James -
Directory listing of a Multi volume encrypted tapes on OpenVMS 8.3
I have a full data backup for an openvms 8.3 server integrity server on two tapes that are encrypted. If I mount the first volume and try to do a directory listing the process goes on indefinately; without giving any output and eventually I have to kill the process. e.g. DEV_DAISY> sh dev mk Device Device Error Volume Free Trans MntName Status Count Label Space Count CntPLUTO$MKC200: Online 0 DEV_DAISY> mount PLUTO$MKC200: dat801%MOUNT-I-MOUNTED, DAT801 mounted on _PLUTO$MKC200: DEV_DAISY> dir PLUTO$MKC200:[000000] The process goes on indefinately at this point of time. However If I mount the second volume and do a directory listing, It executes and gives me the required output as : Directory PLUTO$MKC200:[]DAT801.BCK;1 294976 31-MAR-2015 00:00:00.00Total of 1 file, 294976 blocks. I want to ask is it possible to do a directory listing on first volume. If not is it possible to read tape header information (i.e saveset name and date on which backup was taken) from the first volume without specifying the encryption key.
I have a full data backup for an openvms 8.3 server integrity server on two tapes that are encrypted. If I mount the first volume and try to do a directory listing the process goes on indefinately; without giving any output and eventually I have to kill the process. e.g. DEV_DAISY> sh dev mk Device Device Error Volume Free Trans MntName Status Count Label Space Count CntPLUTO$MKC200: Online 0 DEV_DAISY> mount PLUTO$MKC200: dat801%MOUNT-I-MOUNTED, DAT801 mounted on _PLUTO$MKC200: DEV_DAISY> dir PLUTO$MKC200:[000000] The process goes on indefinately at this point of time. However If I mount the second volume and do a directory listing, It executes and gives me the required output as : Directory PLUTO$MKC200:[]DAT801.BCK;1 294976 31-MAR-2015 00:00:00.00Total of 1 file, 294976 blocks. I want to ask is it possible to do a directory listing on first volume. If not is it possible to read tape header information (i.e saveset name and date on which backup was taken) from the first volume without specifying the encryption key.
-
Directory listing for a directory within the webapplication
Hi,
I have a the code which does the directory listing of a given directory using its absolute path. eg new File("c:/webapp/tempdir");).
I want to do the directory listing by giving a path relative to the context path of the webapp like(new File("/temp");)
When I try to do
<%
File f1=new File("/tempDir");
f1.exists(); --> returns flase
%>
tempDir is a directory in my webapplication. How should I reference this? Should I have to use file:// or http://?
Looking forward for your help
Thanks in advanceThere is a method in ServletContext: getRealPath.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
It turns a website relative path into a real location on disk.
// only need this line in a servlet. "application" is already defined in a jsp
ServletContext application = getServletConfig().getServletContext();
String filePath = application.getRealPath("/tempDir");
File f1 = new File(filePath);Some issues with using this approach:
If your application is in an unexploded WAR file, then getRealPath() can return null, as there isn't really a location on disk that it relates to. -
Prevent directory listing in a 6.0 WebApp
Hi,
How can I prevent all users from being able to get any directory
listing in a 6.0 Web Application? Do I need to enter some sort
of security constraint for each directory? If so, what is the format
of the constraint?
Thanks
Dev
I'm not sure if this can be controlled at the user level. This is more
or less an admin task.
There's an "index Directories" checkbox in console, which you can enable
/disable it, based on
your requirement.
Kumar
Dev Gude wrote:
> Hi,
>
> How can I prevent all users from being able to get any directory
> listing in a 6.0 Web Application? Do I need to enter some sort
> of security constraint for each directory? If so, what is the format
> of the constraint?
>
> Thanks
>
> Dev
-
Hi All,
I want to beable to display a directory listing in a JSP page, like filename and if possible size and creation date.
I found this example :
http://forum.java.sun.com/thread.jspa?forumID=45&threadID=271208
But it doesn't do much. This example show how many files it's found but
doesn't show them.
Any other examples?
Thanks!All you need is the File class. Check out the api docs (java.io.File), and more specifically the listFiles() method.
-
Directory lister for the web.
Hi
Here iam attaching my project code for my particualr aplication
The source code for a directory lister for the web. You give it
one or more URLs as arguments and its not displays the formatted results .. can any body will help me
import java.util.*;
import java.net.*;
import java.io.*;
public class WebList extends abcd.Application
static final String progName = "WebList";
public static void main( String[] args )
(new WebList()).compat( args );
public int newMain( String[] args )
int argc = args.length;
if ( argc == 0 )
usage();
return -1;
for ( int argn = 0; argn < argc; argn++ )
if ( argc > 1 )
if ( argn > 0 )
out.println( "" );
out.println( args[argn] + ":" );
list( args[argn] );
return 0;
private void usage()
err.println( "usage: " + progName + " URL ..." );
void list( String urlStr )
String base = abcd.Utils.baseUrlStr( urlStr );
Enumeration as;
try
as = new abcd.Spider( urlStr, err );
catch ( MalformedURLException e )
err.println( e );
return;
while ( as.hasMoreElements() )
URLConnection uc = as.nextElement();
if ( uc == null )
continue;
URL thisUrl = uc.getURL();
String thisUrlStr = thisUrl.toExternalForm();
if ( thisUrlStr.startsWith( base ) )
thisUrlStr = thisUrlStr.substring( base.length() );
if ( thisUrlStr.length() == 0 )
thisUrlStr = ".";
String mimeType = uc.getContentType();
int len = uc.getContentLength();
long mod = uc.getLastModified();
Date modDate = new Date( mod );
String modDateStr = abcd.Utils.lsDateStr( modDate );
out.println(
abcd.Fmt.fmt( mimeType, 14, abcd.Fmt.LJ ) + " " +
abcd.Fmt.fmt( len, 8 ) + " " +
modDateStr + " " + thisUrlStr );
try
InputStream in = uc.getInputStream();
in.close();
catch ( IOException e ) {}
}Hi,
It is enumerating the files reachable at or
below those URLs, i hope it will full fill your application requirements.
and also in the for loop you have to do pre increment not post increment so it may be the casue for entier your logic ..
as per my knowledge iam changing the code .. i hope it will work for your application...
still if you have any querys please post me with details of your projects so that i can help you more..
here is modified code:
=================
import java.util.*;
import java.net.*;
import java.io.*;
public class WebList extends abcd.Application
static final String progName = "WebList";
public static void main( String[] args )
(new WebList()).compat( args );
public int newMain( String[] args )
int argc = args.length;
if ( argc == 0 )
usage();
return -1;
for ( int argn = 0; argn < argc; ++argn )
if ( argc > 1 )
if ( argn > 0 )
out.println( "" );
out.println( args[argn] + ":" );
list( args[argn] );
return 0;
private void usage()
err.println( "usage: " + progName + " URL ..." );
void list( String urlStr )
String base = abcd.Utils.baseUrlStr( urlStr );
Enumeration as;
try
as = new abcd.Spider( urlStr, err );
catch ( MalformedURLException e )
err.println( e );
return;
while ( as.hasMoreElements() )
URLConnection uc = (URLConnection) as.nextElement();
if ( uc == null )
continue;
URL thisUrl = uc.getURL();
String thisUrlStr = thisUrl.toExternalForm();
if ( thisUrlStr.startsWith( base ) )
thisUrlStr = thisUrlStr.substring( base.length() );
if ( thisUrlStr.length() == 0 )
thisUrlStr = ".";
String mimeType = uc.getContentType();
int len = uc.getContentLength();
long mod = uc.getLastModified();
Date modDate = new Date( mod );
String modDateStr = abcd.Utils.lsDateStr( modDate );
out.println(
abcd.Fmt.fmt( mimeType, 14, abcd.Fmt.LJ ) + " " +
abcd.Fmt.fmt( len, 8 ) + " " +
modDateStr + " " + thisUrlStr );
try
InputStream in = uc.getInputStream();
in.close();
catch ( IOException e ) {}
Regards,
TirumalaRao.
Developer Technical support,
sun MicroSystem, India. -
Hi all, I'm racking my brain with this one.
I typed http://192.168.10.252/localdirectory into a web browser and was hoping to get an xml view of my CME phone directory instead I get an XML browser error:
âThe XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
XML document must have a top level element. Error processing resource 'http://192.168.10.252/localdirectory'
â
I'm trying to publish the directory on the intranet (using ASP) but so far I have had no luck getting the directory list. I have tried using the XML Api but all I can get is a list of extension numbers with no names using:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body>
<axl xsi:type="request"
xmlns="http://www.cisco.com/AXL/1.0"
xsi:schemaLocation="http://www.cisco.com/AXL/1.0
http://gkar.cisco.com/schema/axlsoap.xsd">
<request xsi:type="ISgetExtension">
<ISgetExtension>
<ISExtNumber>all</ISExtNumber>
</ISgetExtension>
</request>
</axl>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Any help on this would be greatly appreciated.
Thanks,
Craig.Hmm
try this:
http://yourCM-IP:8080/ccmcip/xmldirectorylist.jsp
(never rely on DNS when dealing with IP telephony) it will return an xml parse error (as happened with you) but again when you view the page source you will see the XML directory list.
P.S: this is for a list on IP phones added on call manager 6 , you van use the directories URL on the Phone's config page.
Maybe you are looking for
-
Can I transfer AppleCare from one number to another number within same family?
I have 5 phones under me. I purchased the Iphone 5 under my number with the AppleCare. Unfortunately a few months later I wanted another phone. I switched the Iphone 5's phone number to another family member. Did I lose the AppleCare at that point? N
-
Get sample row for each recrd.
I have a table EMP having columns as as GROUP , GROUP_NAME, EMPNO , EMP_NAME Having following data GROUP , GROUP_NAME, EMPNO , EMP_NAME 1,eng1,1,ZZ 1,eng1,2,RR 2,eng2,2,RR 3,eng3,3,MM 3,eng3,2,RR I need to select a samle of each record for group fiel
-
Is there any changes in the DIAdem script between DIAdem 9.x and DIAdem 10.x ?
Hello, I have got a question about DIAdem Script. I saw the compatibility problem described in KB. 'Why do my DIAdem 9.1 Scripts not work in DIAdem 10?' Many problems were solved, but some case were not. So I guess there is some changes in the DIAdem
-
I just updated itunes and now itunes wont open
i just updated itunes and now it wont open????
-
When I show all my windows open in expose, it moves very slowly, why?
It only happened for a minute or so, then the expose moved at normal speed, should I be worried? Why did this happen?