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
Similar Messages
-
Prevent directory listing, using struts
hi all,
i hav a web application which is built using struts. I am using tomcat as the servlet contatiner.
The problem is, i want to prevent directory listings, i searched some forums, but didnt get the correct solution.
plz help me...
Regards
Varma@ javamine, hi
The snippet u hav posted is enough to stop directory listings!!
1 <servlet>
2 <servlet-name>default</servlet-name>
3 <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet- 4 class>
5 <init-param>
6 <param-name>debug</param-name>
7 <param-value>0</param-value>
8 </init-param>
9 <init-param>
10 <param-name>listings</param-name>
11 <param-value>false</param-value>
12 </init-param>
13 <load-on-startup>1</load-on-startup>
14 </servlet>
Notice tht at line no 11, the value is false, which indicates tht the directories are not to be listed in the portal.
Actually at the time of installing tomcat, the value will be true.
Regards,
Varma -
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. -
Overriding Tomcat's directory listing
I made my own directory listing JSP which includes thumbnails of pictures. Right now I have to copy the file, index.jsp, into every directory to make it the directory listing. How can I stop this?
It doesn't seem to be working, but I suspect it is a newbie error on my part. Here' s my server.xml (I tried it as shown below, in my apps-project.xml file, and outside the <server> key:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>
<!-- You can add a "home" attribute to represent the "base" for
all relative paths. If none is set, the TOMCAT_HOME property
will be used, and if not set "." will be used.
webapps/, work/ and log/ will be relative to this ( unless
set explicitely to absolute paths ).
-->
<ContextManager workDir="work" >
<StaticInterceptor listing="false" />
<!-- ==================== Global modules ==================== -->
<LoaderInterceptor11 useApplicationLoader="true" />
<TrustedLoader />
<LogSetter name="tc_log" timestamps="true"
verbosityLevel="INFORMATION" />
<LogEvents enabled="false" />
<!-- Backward compat: read the Context declarations from server.xml-->
<ContextXmlReader config="conf/server.xml" />
<!-- Separated Context -->
<ContextXmlReader config="conf/apps.xml" />
<AutoDeploy source="modules" target="modules"
redeploy="true" />
<AutoWebApp dir="modules" host="DEFAULT" trusted="true"/>
<AutoDeploy source="webapps" target="webapps" />
<AutoWebApp dir="webapps" host="DEFAULT" />
<PolicyLoader securityManagerClass="java.lang.SecurityManager"
policyFile="conf/tomcat.policy" />
<SimpleMapper1 />
<SessionExpirer checkInterval="60" />
<!-- For development you can use randomClass="java.util.Random" -->
<SessionIdGenerator randomClass="java.security.SecureRandom"
randomFile="/dev/urandom" />
<!-- ========== context processing modules ========== -->
<!-- This will be the "default" profile
( all except the "global" modules can be set per context )
-->
<LogSetter name="servlet_log"
timestamps="true"
verbosityLevel = "INFORMATION"
path="logs/servlet-${yyyyMMdd}.log"
/>
<LogSetter name="JASPER_LOG"
timestamps="true"
path="logs/jasper-${yyyyMMdd}.log"
verbosityLevel = "INFORMATION" />
<WebXmlReader validate="true" />
<ErrorHandler showDebugInfo="true" />
<WorkDirSetup cleanWorkDir="false" />
<Jdk12Interceptor />
<!-- Non-standard invoker, for backward compat. ( /servlet/* ) -->
<InvokerInterceptor />
<!-- you can add javaCompiler="jikes" -->
<JspInterceptor keepGenerated="true"
largeFile="false"
useJspServlet="false"
/>
<StaticInterceptor listings="true" />
<ReloadInterceptor fullReload="true" />
<SimpleSessionStore maxActiveSessions="-1" />
<AccessInterceptor />
<CredentialsInterceptor />
<SimpleRealm filename="conf/users/global-users.xml" />
<!-- UnComment the following and comment out the
above to get a JDBC realm.
Other options for driverName:
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott"
connectionPassword="tiger"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test"
connectionPassword="test"
"connectionName" and "connectionPassword" are optional.
-->
<!--
<JDBCRealm
debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:TOMCAT"
userTable="users"
userNameCol="user_name"
userCredCol="user_pass"
userRoleTable="user_roles"
roleNameCol="role_name" />
-->
<LoadOnStartupInterceptor />
<Servlet22Interceptor />
<!-- Tag pooling support.
To enable the reuse of tag handlers as described in
the JSP spec, uncomment the following. If your pages
use a lot of custom tags, you should see a nice performance
gain.
Note that placing the interceptor here will enable
Tag pooling for all of the web applicatitions loaded -
this may be a bad thing if all tags are not coded to
handle reuse. To enable pooling only for specific web
applications i.e. Contexts, place the interceptor inside of
the Context's definition.
To view information about tag usage uncomment the tag
LogSetter. Set verbosityLevel to DEBUG to see everytime
a tag is obtained and released.
-->
<!--
<LogSetter name="tag_pool_log" timestamps="true"
path="logs/tagpool-${yyyyMMdd}.log"
verbosityLevel="INFORMATION" />
<TagPoolManagerInterceptor />
-->
<!-- Request processing -->
<DecodeInterceptor />
<SessionId cookiesFirst="true" noCookies="false" />
<!-- Automatic config generation
Set noRoot="false" if you wish to have Tomcat try to take
control of the external web server's root context.
Additonal configuration of the external web server may be
required for this to be successful.
Note: Configuration files are not written as part of the
default startup behvior. Append "jkconf" to the startup
command to have Tomcat initialize, write the config files,
then exit. This may be done while Tomcat is running.
-->
<ApacheConfig noRoot="true" />
<IISConfig noRoot="true" />
<NSConfig noRoot="true" />
<!-- Uncoment for apache-style logs
Attributes: logFile, flush, format
<AccessLogInterceptor/>
-->
<!-- ==================== Connectors ==================== -->
<!-- new http adapter. Attributes:
secure - use SSL ( https )
keystore, keypass - certs for SSL
port
reportedname - Server name to send back to browser
by default report Tomcat Web Server ...
set an empty string to avoid sending server header
-->
<Http10Connector port="8080"
secure="false"
maxThreads="100"
maxSpareThreads="50"
minSpareThreads="10" />
<!--
Uncomment this for SSL support. You _need_ to set up a
server certificate if you want this to work, and you
need JSSE. See tomcat-ssl-howto.html for more detailed
instructions.
1. Make the JSSE jars available to Tomcat, either by making
them an installed extension or by adding them to the
Tomcat CLASSPATH.
2. Do: keytool -genkey -alias tomcat -keyalg RSA
RSA is essential to work with Netscape and IIS.
Use "changeit" as password. ( or add keypass attribute )
You don't need to sign the certificate.
-->
<!--
<Http10Connector port="8443" secure="true" />
-->
<!--
JNI connector. It assumes the library is located in
TOMCAT_HOME/bin/native/jni_connect.[dll, nlm, so]. or in LD_LIBRARY_PATH.
For different paths set "nativeLibrary" parameter.
The JniConnector will be self-enable only if JNI mode is detected.
-->
<JniConnector />
<!-- Apache AJP12 support. This is also used to shut down tomcat.
Parameter "address" defines network interface this Interceptor
"binds" to. Add it if you want to "bind" to just "127.0.0.1".
address="127.0.0.1"
Parameter "tomcatAuthentication", controls if Tomcat honors
( and uses ) auth done in HTTP Server or not, when true Tomcat does
not use in any way auth information provided by the HTTP Server.
true is the default.
tomcatAuthentication="false"
-->
<Ajp12Connector port="8007" />
<!-- Apache AJP13 support (mod_jk)
Parameter "address" defines network interface this Interceptor
"binds" to. Add it if you want to "bind" to just "127.0.0.1".
address="127.0.0.1"
Parameter "tomcatAuthentication", controls if Tomcat honors
( and uses ) auth done in HTTP Server or not, when true Tomcat does
not use in any way auth information provided by the HTTP Server.
true is the default.
tomcatAuthentication="false"
-->
<Ajp13Connector port="8009" />
<!--
Context definitions can be placed here ( not recommended ) or
in separate files. The ContextXmlReader will read all context
definitions ( you can customize the "base" filename ).
The default is conf/apps-[name].xml.
See conf/apps-examples.xml and conf/apps-admin.xml
-->
</ContextManager>
</Server> -
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. -
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.
-
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. -
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çamentoCan you provide an example of where that happens - the URL?
Maybe you are looking for
-
How do I get all my sub-folders from Yahoo to show up in Mozilla
I installed Mozilla Thunderbird on my Home PC and Office Laptop. On my PC all my sub-folders were imported automatically. On my Laptop Thunderbird is not showing all the sub-folders I use in Yahoo to keep my emails organized. This is not the local fo
-
Time machine restore from network drive kernel panic
I had a late 2013 macbook pro 15" retina, I was backing up with time machine to a network drive (western digital my cloud). All of my backups are there and the data looks valid. In April I ended up selling the macbook pro, then recently I bought anot
-
Touching the screen of my Iphone without effect
Touching the screen of my Iphone 4 (iOS 5) is more and more often without effect not depending the app I'm working with I have to restart but it seems to be longer and longer What do you suggest ? Thanks
-
Could not find provider msolap.4 error in universe connection
I am trying to create a universe connection against a MS SQL Server 2008 SSAS cub with OLE DBfor OLAP Providers. When trying to connect to the db i get a error saying "Could not find provider msolap.4", has anybody encountered this before? I can't fi
-
Can Orbit use Keyboard instead of mouse
I've created a custome behavior to cotroll the camera through the arrow keys. I want it to rotate about the orgin while always looking at the orgin. What i've gotten is whatever is at the orgin is rotating. I want the object to stay at the orgin and