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.

Similar Messages

  • Lion Server: How can I enable directory listing for the Web Server?

    The functionality was part of the Server App in Lion Server but was not included in Lion.  Can anyone shed some light on how to enable Directory Listing.  Any help is appreciated!

    Go to /etc/apache2 and edit the file 000_any_80_.conf
    using sudo nano command and replace  "-Indexes" with "+Indexes".
    Restart Apache with "sudo apachecrl restart"
    Good luck,
    Ricky
    from Costa Rica

  • How to disable the Directory listing for the whole server or a particular a

    Please let me know how to disable the Directory listing for the whole server or a particular application.
    Thank You

    I want to disable the tab focusing( tab index) for a JTextField objectsLook through the API and find methods with the word "focus" in the method name.
    Also can u tell me about how to change the tab index orders for JTextFields."How to Use the Focus Sub System":
    http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html

  • A web site that I use daily has disappeard from my "Most Visited" list. In spite of my continued use of the site plus deletion of other sites that I seldom use, thus making room on the list for the site I want to be listed there, it doesn't.

    A bookmarked web site for weather that I use daily - often more than once a day - has disappeared from my Most Visited list. In spite of my continued use of the site for a week now, plus deleting other sites that I seldom use that have started showing up on the Most Visited list, thus making room on the list for the weather site, it still doesn't reappear there. I have to open Bookmarks to access the weather site. So the site is still there, but not on the Most Visited list. I tried removing and re-entering the site in Bookmarks, but that didn't solve the Most Visited list problem. Thanks for your help.

    Your browser has been hijacked. You can test it by going to any search site besides scroogle and looking up antivirus, malware removal, or any other term like that. It will show you the results but you wont be able to go to any of those pages. In my opinion this is the worst kind of virus because it is so hard to get rid of. You'll remove it and it will self replicate and you'll have it again. Scroogle works because it acts as a proxy between you and the search site google. Follow that guys directions who replied before me. When that doesn't work try to get a copy of Stopzilla antivirus. I had my browser hijacked once and that got rid of it. If that doesnt work, download the Comodo web browser. They give away a month of free Geekbuddy assistance with their browser. Use it. Chances are you will have to contact an IT proffesional of some sort anyway. But you'll never feel really clean again and you'll become paranoid about using the web and you'll get every popup blocker and java script stopper there is. But that still won't be enough and you'll dump windows altogether becuase there just are'nt that many viruses that work on Linux.... oh wait.. that was me...

  • Cannot "enable directory listing" from the wadm CLI

    With SJSWS 6.1 sp1 up to sp11, there was a documented bug that caused directory listing to work even though the ACL was:
    acl "default";
    authenticate (user, group) {
      prompt = "Sun ONE Web Server";
    allow (read, execute, info) user = "anyone";
    allow (list, write, delete) user = "all";With SJSWS 7.0, this bug was fixed. The default installed ACL is exactly the same from 6.1 to 7.0. e.g. the "list" right is given only to [all] authenticated user, and not everyone. So requesting a "GET /images/" will give you a 401 unauthorized, as should have happened in 6.1, which causes your browser to prompt you to login.
    By default, 7.0 webserver configs are created with directory listing enabled with "index-common". But it can also be disabled, directing the user to a defined static file on the web server disk. i.e.:
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="send-error" path="/path/on/disk/notFound.html"In either case, out of the box, neither enabling nor disabling directory listing matters because the default ACL denies directory listing in the prior case, and denies the "notFound.html" response in the later. Note "allow (list) user = all" requires authentication for the "list"privilege.
    To fix this, you change the ACL so the "list" privilege is in the first ACI, i.e., 'allow (read, execute, info, list) user = "anyone";'
    The problem is that even though the ACL file can be modified in the Admin Web GUI, it cannot be modified from the the wadm CLI.
    So, because of this, technically one cannot truly enable directory listing (wadm enable-directory-listing) using wadm. The best you can do is manually edit the existing ACL, or create a new ACL file and set that new file using wadm.
    I don't even see a way, using wadm, to dump new content into the ACL file. Without the GUI, you are stuck. And you cannot perform remote administration for this feature using wadm.
    If we admins are creating TCL scripts to automate creating and configuring webserver configs, this feature cannot be configured.
    I would like to know if I am wrong, and how I could resolve this using the wadm CLI alone.
    And if the default is going to remain that the "list" privilege requires authentication, this should be documented in the SJSWS7 documentation for enabling and disabling directory listing.

    pull-config does not work in this case because of two reasons:
    1. you must still manually edit the ACL file (can already do that on the admin server)
    2. and you must make that change on a node which has the configuration
    In my case, I want to remotely manage the configuration using wadm. But I do not want to log into one of the nodes in the server farm.
    And I want to avoid having to edit the ACL file manually if possible, or through the GUI which requires manual intelligent point-and-click efforts.
    Seems like my only bet is to:
    1. create the config via the wadm tcl shell
    2. then outside of the wadm command, execute some script that can perform a scp to the admin server, or a ssh for a local copy of a previously written ACL file - which requires a lot of extra setup to make that happen.
    3. then get back into wadm to execute the other tasks
    I want to avoid step #2.

  • How can I get a printable list of the web sites in a tab showing both the name of the site and it's location?

    I use tab groups for specific projects and would like to print/save a list of the websites used on each project. Using the list function on a tab group produces a list of the web-sites which can be printed/saved via PrtSc and Word. How can the web-site addresses be included? With this list available I would then close the tabs.

    Someone might have created an add-on for this, although I didn't find one in a search.
    Could I suggest this workaround for now:
    (1) Use the Bookmark All Tabs feature (right-click a tab when your tab group is displayed) to save all tabs to a new folder on the bookmarks menu. Some tips in the "How do I bookmark all of my open tabs?" section of this article: [[How to use bookmarks to save and organize your favorite websites]].
    (2) Export bookmarks to an HTML file. Unfortunately, this will be all bookmarks, not just the ones you want, but hang in there. This article has the steps: [[Export Firefox bookmarks to an HTML file to back up or transfer bookmarks]].
    (3) Open the exported HTML file in Firefox or your favorite WP program. Now you can either:
    (A) Copy/paste the live links for your tab group into your preferred form of archival storage. Or
    (B) Print (e.g., select the relevant bookmarks and use the Print Selection feature). However, in order to show the URLs, you need to hack the page a little bit.
    (i) In Firefox, you can run a little script in the Web Console on the bookmarks page. Press Ctrl+Shift+k to open the web console. Copy the following line of script, then paste it next to the caret (">") in the web console and press Enter. The URLs should appear after the links.
    for(var i=0; i&lt;document.links.length; i++) {document.links[i].parentNode.appendChild(document.createTextNode(' ['+document.links[i].href+']'))}
    (ii) In Word, there probably is a macro to split the hyperlink fields into the display text and URL. If Word is your preferred tool, I'll see whether I can write one.

  • How to create clean text for the web in Photoshop/Illustrator

    I am puzzled to death on how in the world to get clean text for the web in Photoshop/Illustrator, particularly white text. I want my text to turn out exactly like the text at this website: thepainteddoor.org
    If you scroll down to the bottom of that page, notice the titles "Featured Media", "Social Networking", and "Contact Information". They are all .gif images. I have tried to replicate what these images look like for about 3 hours now to no avail. Can anyone tell me how to do this? It just looks like a simple outline or drop shadow, but I can't get it to show up like that. If someone could help me replicate that effect with text (aka make it show up clean as an image), I would graciously give them money through PayPal*.
    * = I will only give cash if it will replicate it exactly (and I mean exactly)..and it won't be too much..I'm a poor college student. :-P
    Thanks in advance!
    Thomas

    You would do it the way I created it:
    Select the Text tool in Photoshop and set the font and parameters as I have listed.  Then enter whatever text you like.  It will be rendered over the top of the lower layers you may have in the document.  Save as an image of the appropriate type and you're there.
    Note that "lower layers you may have in the document" could conceivably be none at all (i.e., you render the text over a transparent document).  You could imagine saving that as a .png with transparency and get light text in an image that could then be put over the top of anything else.  The alpha mixing will see to it that the edges smoothly blend with the background.  I haven't actually tried this (I usually do try my own suggestions) because of lack of time right now.
    -Noel
    Edit:  Markerline and I seem to be on the same crystal-controlled wavelength. 

  • [svn:bz-4.0.0_fixes] 20651: Some MBean tests needed flex.management. jmx stuff in the allow classes list for the class deserialization validator so adding it in on BlazeDS 4 .0.0_fixes.

    Revision: 20651
    Revision: 20651
    Author:   [email protected]
    Date:     2011-03-07 12:21:11 -0800 (Mon, 07 Mar 2011)
    Log Message:
    Some MBean tests needed flex.management.jmx stuff in the allow classes list for the class deserialization validator so adding it in on BlazeDS 4.0.0_fixes.
    Modified Paths:
        blazeds/branches/4.0.0_fixes/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.validat ors.xml

    Thank you very much!
    I cant believe this little comment has been so helpful!
    But yes it is:
    I explain, despite my efforts to find, googled it, forums, faqs, etc...
    no where it mentionned the manifest.fm file is... INSIDE the .jar!
    Your comment "a zip" made me attempt to open it with winrar, and I found a manifest.fm file inside!
    So far I was editing the one at the "source" of my project and rebuilding it with netbeans.
    I am going to try that now.
    Actually.... :( no its mentionning my main class!
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    Main-class: courseworkjava3d.Simple3D
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildWell I have no problems uploading you the .jar, it is for a coursework it is not a private project or whatever:
    http://www.uploading.com/files/CM2LKWYU/BetaCourseworkJava3d_Final.jar.html
    Oh and I felt on your comment "dont ask us" as if I was suppose to know... i'm a beginner, I did not know that! And I tried to give you so many infos so you dont lose your time if you want to help, especially as after my own research I found many, many results for this "main class" and I tried a few solutions!
    Edited by: CupofTea on Apr 13, 2008 3:28 AM

  • [svn:bz-trunk] 20650: Some MBean tests needed flex.management. jmx stuff in the allow classes list for the class deserialization validator so adding it in on BlazeDS trunk .

    Revision: 20650
    Revision: 20650
    Author:   [email protected]
    Date:     2011-03-07 12:20:03 -0800 (Mon, 07 Mar 2011)
    Log Message:
    Some MBean tests needed flex.management.jmx stuff in the allow classes list for the class deserialization validator so adding it in on BlazeDS trunk.
    Modified Paths:
        blazeds/trunk/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.validators.xml

    Thank you very much!
    I cant believe this little comment has been so helpful!
    But yes it is:
    I explain, despite my efforts to find, googled it, forums, faqs, etc...
    no where it mentionned the manifest.fm file is... INSIDE the .jar!
    Your comment "a zip" made me attempt to open it with winrar, and I found a manifest.fm file inside!
    So far I was editing the one at the "source" of my project and rebuilding it with netbeans.
    I am going to try that now.
    Actually.... :( no its mentionning my main class!
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.0
    Created-By: 10.0-b19 (Sun Microsystems Inc.)
    Main-class: courseworkjava3d.Simple3D
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildWell I have no problems uploading you the .jar, it is for a coursework it is not a private project or whatever:
    http://www.uploading.com/files/CM2LKWYU/BetaCourseworkJava3d_Final.jar.html
    Oh and I felt on your comment "dont ask us" as if I was suppose to know... i'm a beginner, I did not know that! And I tried to give you so many infos so you dont lose your time if you want to help, especially as after my own research I found many, many results for this "main class" and I tried a few solutions!
    Edited by: CupofTea on Apr 13, 2008 3:28 AM

  • How to avoid directory listing in java web applications.

    how to avoid directory listing in java web applications.
    That is on typing the url of the application it should not the directory listing. Welcome tag in web.xml doesnot fully solve the problem, since still the images folder etc is still accessible

    I know of two ways.
    If you're using tomcat and have access to the conf directory.
    Edit your $TOMCAT/conf/web.xml. Find your default servlet properties and change
      <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>listings</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>to  <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>listings</param-name>
          <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>And restart your server. This will affect every directory on the server, and return a 405 directory browsing forbidden error.
    Another way, is to place an index.jsp inside each directory with a simple one line redirect to your applications CONTEXT_PATH.response.sendRedirect("http://yourserver/yourapp/");This will only affect specific directories which contain these index.jsp files.
    Hope this helps

  • List Of the WEBI Reports

    Hi all,
    I want find out the list of the WEBI Reports which are exported to Excel / PDF..
    please let if you have any idea..
    thnaks in advance,,,
    Reddeppak

    I guess you can do it from Acitivity universe or query Builder
    You can write below query in query builder:
    SI_KIND for CI_INFOOBJECTS includes 'Webi', 'Pdf', 'Excel', 'Folder', 'FullClient', 'FavoritesFolder', 'Inbox', 'PersonalCategory', 'Shortcut', 'MyInfoView', 'AFDashboardPage'
    I guess this link may help out better
    http://www.forumtopics.com/busobj/viewtopic.php?t=162461

  • How can I download a previously downloaded purchase to my iTunes library on my laptop when the listing for the song in my library won't play because it says it cannot locate the file. Yes I have searched my iTunes folders and also done a full windows sear

    How can I download a previously downloaded purchase to my iTunes library on my laptop when the listing for the song in my library won't play because it says it cannot locate the file. Yes I have searched my iTunes folders and also done a full windows search. The track plays on my iPad and my iPhones but will not play on my laptop!?
    It has an "!" To the left of the song title in my library
    My worry is that if I sync my iPad/iPhone then I will lose the track on those also!

    If you cannot find the file on your hard drive then once you delete the current broken entry you should be able to redownload from iTunes in the Cloud. This assumes the item in question qualifies. Note that audiobooks, digital booklets, iTunes LPs & Extras, ringtones, selected movies etc. don't.
    If prompted don't hide the item. You may find that you need to close and then reopen iTunes before it will appear for download.
    tt2

  • The save for the web function has stopped working in my copy of photoshop elements 12.  I get this message, " The operation could not be completed.  The system cannot find the path specified" Resetting preferences did not fix.

    The save for the web function has stopped working in my copy of photoshop elements 12.  I get this message, “ The operation could not be completed.  The system cannot find the path specified” Resetting preferences did not fix.

    my os is windows 7.  elements 12 worked fine for many months then save for the web stopped working

  • Re:Error while updating Warehouse List for the items in DTW..!!!

    Dear SAP Members,
    We have transferred the items through DTW but while updating the warehouse list for the items.i got a error message like this:
    No.     Status                  Key               Reason
    1         Updatefailed       ItemCode       cannot find this object in B1-application defined or object defined error65171
    How to resolve this issue.It shows error for 600 records.It is very dfficult to enter manually.Help me on this issue.
    With Regards,
    Revathy

    Hi Revathy,
    I suggest you use SQL Server Management Studio. I am not sure which DTW template you are using. All templatesl map to certain tables in B1. You should perfform a select on that table in SQL Management Studio.
    It seems like the column that connects DTW Template in excel to the column in B1 Table do not match. Usually you may have incremental numbers in starting sequence in DTW Template, however, it is different in B1. You may need to copy the numbers over to DTW Template.
    If you want to do it automatically, you can achieve it through mapping or you could write your own little program that takes data from B1 tables and replace the one in Excel in that column.
    If it is one time effort you may just map them manually.
    I hope I am making sense to you.
    If you want us to try it out, give the name of the template, the content in the template may be few lines.

  • Issue in Exporting the Sales Price List and Purchase Price List for the Materials from SAP Business ByDesign (SAP Cloud)

    Hello Everyone,
    I would like to have a discussion on the issues, which I am facing at the time of Exporting the Sales Price List and Purchase Price List for the Materials from
    SAP Business ByDesign (SAP Cloud).
    (1). Sales Price List :
    We have maintained Customer Group Specific Sales Price List for the Materials in the following Location.
    Location :         Product and Service Portfolio Work Center > Pricing > Price Lists > Customer Group Specific Price List (Type of Price List)
    Target :             We want to export the entire records in some reports or excel sheet.
    Records :          Number of Materials in the Customer Group Specific Price List is more than 2,00,000
    Issues : 
                                         (A). In the SAP Business ByDesign Screen we can filter by number of records but we can export till  50,000 records.
                                                 And if we are trying to export records more than that limit, then it throws "HTTP 500 Internal Server Error".
                                         (B). We could not find any SAP standard reports in Product and Service Portfolio and/or Business Analytics Work Center
                                                for getting the entire record set of the Sales Price List, so that we can have the entire set of records together.
    Searching For :
                                          (A). Is there any SAP reports or data source available for getting the entire Sales Price List records?
                                          (B). Can we have any other filter conditions for exporting the Sales Price List records in a single shot or module wise?
    (2). Purchase Price List :
    We have maintained the Purchase Price List for the Materials in the following Location.
    Location :           Product Portfolio Work Center > List Prices > Active List Prices (Type of Price List)
    Target :               We want to export the entire records in some reports or excel sheet.
    Records :            Number of Materials in the Purchase Price List is more than 4,00,000.
    Issues :  
                                           (A). In the SAP Business ByDesign Screen we can not see more than 10,000 records and the actual number of
                                                   records are more than 4,00,000. We could able to download the records till 10,000 but that is not sufficient.
                                                   We want to export the entire records in an excel sheet.
                                           (B). We could not find any SAP standard reports in Product Portfolio and/or Business Analytics Work Center for
                                                  getting the entire record set of the Purchase Price List, so that we can have the entire set of records together.
    Searching For :
                                           (A). Is there any SAP reports or data source available for getting the entire Purchase Price List records?
                                           (B). Can we have any other filter conditions for exporting the Purchase Price List records in a single shot or module wise?
    Please go through the attached screen shots for the references and more clarity on the issues.
    I am waiting for the valuable responses.
    Thanks and regards,
    Susanta Dey Sarkar
    Bangalore, India
    19th March, 2015

    Dear Michael,
    The number of records :
    2 Million (Approximately) is for the Sales Price List Material Price Data
    4 Million (Approximately) is for the Purchase Price List Material Price Data.
    Regards,
    Susanta Dey Sarkar

Maybe you are looking for