Error Codes for Non-importable Files?

Hello!
During the beta phase I used a rather small library from a sample of
my own images. After installing v1 today I deleted everything from the
library to get a clean database. I imported all of my photos on hard
drives.
Curiously after import finished LR gave me a list of files it could
not import, just stating that various errors occurred. The files were
TIFFs, NEFs, PSDs; at least some of them are layered, some have been
worked on in Capture NX [some of the NEFs obviously]. Since other
files with the same features have come through, I am a bit confused:
what errors can there be?
Anybody an idea, or can you point me onto a list on such errors?

I also found that out of a 3,000 file import, I had 1 PSD and maybe 10 jpegs that wouldn't import. They all opened ok in photoshop. The PSD, I resaved, and it imported fine. I set the jpegs aside for now. I suspect Lightroom is rather unforgiving of small discrepancies in the files.

Similar Messages

  • Same error code for two different errors

    I have a simple state machine with a few states, two of which are read ini file and read GPIB data. I also have an error handling state where I would like to handle all errors. Errors are checked for on each iteration of the loop, passed by shift register. However, I can't just unbundle the error cluster and wire the error code to a case structure because if the ini file doesn't exist (error code 7) I want to exit the program. But if I get error 7 from the gpib (Nonexistent GPIB interface) I want the program to continue running. What is the best way to track where the error is coming from so I know how to handle it when two error codes for different errors have the same error code value?
    Message Edited by for(imstuck) on 01-27-2010 03:47 PM
    CLA, LabVIEW Versions 2010-2013

    Another option is to check the existence of the file before opening the config file, then exit the program if nessecary. Relying on error codes might be a bad option.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Code for downloading a file

    Can some one provide me wit da code for downloadind a file.

    import com.jscape.inet.ftp.*;
    Establishing a connection
    In order to communicate with an FTP server you must first establish a network connection to the FTP server.
    // create Ftp instance with FTP hostname, username and password as arguments
    Ftp ftp = new Ftp("ftp.myserver.com","jsmith","secret");
    // establish connection
    ftp.connect();
    Perform a directory listing
    Once connected you may wish to perform a directory listing on the FTP server. The directory listing will return a relative listing of files and directories that are on the FTP server.
    // perform directory listing
    String listing = ftp.getDirListingAsString();
    // print directory listing to console
    System.out.println(listing);
    Alternatively you may use the getDirListing method. This method parses the results and returns a java.util.Enumeration of FtpFile. Using this method you may then iterate through the Enumeration and evaluate the contents of each file or directory programmatically. Note: This method is only for use by FTP servers which display directory listing using the UNIX or MS-DOS mode. For more information see the Ftp.getDirListing method in the JavaDoc.
    // Perform directory listing
    Enumeration files = ftp.getDirListing();
    // iterate through listing
    while(files.hasMoreElements()) {
    FtpFile file = (FtpFile)files.nextElement();
    // only print files that are directories;
    if(file.isDirectory()) {
    System.out.println(file.getName());
    Changing your local directory
    Your local directory is the directory that you wish to use when transferring files to / from the FTP server. By default this is the directory that the Java executable was invoked from. To change this setting simply invoke the setLocalDir method.
    // change local directory
    ftp.setLocalDir(new File("C:/tmp");
    Changing your remote directory
    Your remote directory represents your current directory on the FTP server. By default this is the directory that is assigned when first logging into the FTP server. To change this setting simply invoke the setDir method.
    // Change remote directory
    ftp.setDir("temp");
    Setting the transfer mode
    Files transferred to / from an FTP server may be transmitted using binary or ASCII modes. The binary transfer mode transfers files without performing any conversion. Binary transfer is generally used for files that are binary in nature such as images, executables etc. The ASCII transfer mode transfers files converting new line characters to the system dependent new line character used by the operating system performing the transfer request. ASCII transfer mode is generally used when downloading text only files. The default transfer mode is binary.
    // change transfer mode to ASCII
    ftp.setAscii();
    // change transfer mode to binary
    ftp.setBinary();
    Downloading files
    To download a file simple invoke the download method. File will be transferred using the current transfer mode and saved in your local directory. See Setting the transfer mode and Changing your local directory for more information. There are other methods that you may use for downloading files. These include methods for downloading entire directories and downloading files matching a regular expression. For more information see the JavaDoc.
    // download a file named test.txt in remote directory
    ftp.download("test.txt");
    Uploading files
    To upload a file simply invoke the upload method. File will be transferred using the current transfer mode and saved in your remote directory. See Setting the transfer mode and Changing your remote directory for more information. There are other methods that you may use for uploading files. These include methods for uploading entire directories and uploading files matching a regular expression. For more information see the JavaDoc.
    // upload a file named test.txt in c:/tmp directory
    ftp.upload(new File("c:/tmp/test.txt"));
    Releasing the connection
    Once you have finished sending your email message(s) it is important that you disconnect from the FTP server. This is easily accomplished using the code below.
    // release the FTP server connection
    ftp.disconnect();
    With Regards,
    Dipak Sodani.

  • I could not transfer photos from iphone to macbook through iphoto. It is giving an error " could not be imported, file is in unrecognized format"

    I could not transfer photos from iphone to macbook through iphoto. It is giving an error " could not be imported, file is in unrecognized format"

    Did you look in iTunes?

  • "Preview for Files Not Available" & "Failed to Find a Place for the Imported File"??

    When I export RAW images into LR, some say "Preview for Files Not Available".  Also, it says "Failed to Find a Place for the Imported File".  Why?  What can I do to resolve this

    Hi,
    Tried with this but still the same issue..
    Stop the application services, recompile the JSP files manually, and start the application services. Check the login page then.
    Note: 435550.1 - R12 Login issue on target after cloning , fresh install or upgrade
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=435550.1
    Any other area to look into?
    Thanks for your time!
    Regards,

  • Transaction Code for seeing the files in the  Application Server

    Hello All,
      Can anybody please give me the transaction code for seeing the files in the Application Server
    Thanks in Advance,
    Regards,
    LIJO.

    hi
    good
    try with tcode AL11.
    thanks
    mrutyun^

  • Where to find LED error codes for Portege 4010?

    Hi,
    My Portege 4010 isn't working, and the AC indicator is blinking an error code (either 0xA or 0x50 depending if I should interpret the first bit as least or most significant). I've tried searching, and I've found a fairly detailed guide that includes these error codes for the Portege M100 and M300 (at  http://tim.id.au/laptops/toshiba/portege%20m100.pdf and http://tim.id.au/laptops/toshiba/portege%20m300.pdf) but I can't find anything for the 4010. So can anyone give me a location (ideally official Toshiba) for a document detailing the meaning of the error codes for my model?
    Thanks,
    Jes

    See for 'REP messages' in help menu.

  • Ora (OCI) error codes for TAF failure

    Hi,
    I am working on project where in I have to support Transparent Application Failover (TAF) in GUI (using Java). From web (by googling) I found that this is automatically done by JDBC Thick (OCI) drivers.
    I also found in some web site that there are lot of Ora Error Codes for various senarios like SELECT TAF failure(Ora 25401), or for DML command TAF failure(Ora 25402).
    Is there any set/range of Ora(OCI) Error Code which is specifically for all TAF failure senario?
    Thanks
    Ram

    :-)

  • Code for put attache file ? on power shell

    please help :  code for put attache file ? on power shell 

    #Send-MailMessage works in PS 2.0 +
    #To identify your PowerShell version - If nothing returns you are in Vesion 1.0
    $PSVersionTable
    #help command to know about Send-MailMessage
    help Send-MailMessage -Detailed
    $parameters = @{
    FROM = "From Address"
    TO= "To Address"
    SMTP = "SMTP"
    SUBJECT = "Testing"
    ATTACHMENT = "C:\Temp\Book1.csv"
    BODY = "Refer attached file"
    Send-MailMessage @parameters
    #help Link
    https://technet.microsoft.com/en-us/library/796227f5-c9ff-402d-8a04-cde9e0c180ee(v=wps.620).aspx
    Regards Chen V [MCTS SharePoint 2010]

  • Code for browsing a file in idoc

    i have used the same code for browsing a file in idoc as we use in hcsf, but when that hcsf is converted in hcsp,then that field is still editable even after i wrote
    <$if isHcsp$><$isInfoOnly=1$><$endif$>
    its urgent ..

    HCSF/HCSP code should have the < ! - - syntax, not the < $ syntax... if that your problem?

  • Best ereader for non DRM files epub mobi pdf

    What is the best ereader for non DRM files epub mobi pdf

     You could give Bookviser a try. Once installed you can create a Bookviser account and upload your ebooks to your library. It supports Epub FB2 and text. 
    http://www.windowsphone.com/en-gb/store/app/bookviser/25bef109-9a3a-44a4-ba58-177cd642d143
    Ray.

  • Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Firefox will not show links to flv files. I get the error message for each flv file: "File not found. Firefox can't find the file at http:// (path) .flv." Any mov and swf files in this same path will show. I can see the videos in Safari so the paths are correct.

    Is this a webpage that contains a link to a flv file? Please post a link to the page and tell us which link(s) are the problem flv files or else post a link to the .flv file itself.
    Alternately, click on one of the sample FLV File links on this page and tell us exactly what happens:
    http://www.mediacollege.com/adobe/flash/video/tutorial/example-flv.html
    It might also help if you post the exact error message, including the path to the flv file.
    '''Note:'''
    Depending on how you have Firefox set up, clicking on a FLV File link will either save the FLV file to your computer or Firefox may open it automatically in an external application right after downloading (Firefox may ask you first). Firefox itself can't play FLV files so you need a "helper" application (or a plugin for flv files, if ther is one. You can see if Firefox is already set up to download or open FLV files by going to Firefox Preferences and looking in the Applications list. Find the FLV file type in the list and, if the action is "Open with", it should show the application that can play FLV files (e.g., VLC Media Player or Perian). See [[Managing filetypes]] for more information.

  • Does iCloud maintain file versions for non-Apple file types?

    Does iCloud maintain file versions for non-Apple file types? 

    Does iCloud maintain file versions for non-Apple file types? 

  • HT201272 I purchased Season 3 of the Walking Dead.  I cannot download the second episode of the season; corrupted file.  I submitted a feedback form, but they do not send a reply.  I tried to use the online help/support, got an error code for that page.

    I just want my content.  I am frustrated at trying to get on-line help.  Either I will not get a reply to my feedback form, or the online support page has an error code, with "please try again later" or "start over".  I have paid for this content, and cannot download their corrupted file.

    Are you in a country where TV shows can be re-downloaded - if you are then have you tried deleting that copy from your iTunes library and re-downloading it via the Purchased link under Quicklinks on the right-hand side of the iTunes store home page on your computer's iTunes ?
    When you say that you used the feedback page, do you mean the feedback page (which you won't get a reply to) or the 'report a problem' link from your purchase history on your account or the contact iTunes Support page ?
    'report a problem' : log into your account on your computer's iTunes via the Store > View Account menu option and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that song and use the 'Report a Problem' link and fill in details about the problem (iTunes support should reply within, I think, about 24 hours).
    contact iTunes Support : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption (if this page doesn't work then have you tried clearing your browsers history/cache and/or tried a different browser ?)

  • How to display the source code for this friggin' file.

    Below is a rather lengthy bit of code that provides the behavior and attributes of a web server for OpenCyc. I need to know if I can enter some java to have the HTML source code displayed in a separate text file whenever this class returns some resulting webpage. If you have any ideas it will be greatly appreciated.
    -"Will code for foo."
    package org.opencyc.webserver;
    * Class WebServer is simple multithreaded HTTP server
    * with CGI limited to a Cyc connection on default port 3600.
    * <p>
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.jar.*;
    import java.text.*;
    import org.opencyc.util.*;
    public class WebServer extends Thread {
         * Singleton WebServer instance.
        public static WebServer current;
         * Default HTTP port.
        protected static int DEFAULT_PORT = 80;
         * Default Cyc base port.
        protected static int DEFAULT_CYC_PORT = 3600;
         * Default directory to serve files from on non-Windows OS.
        protected static String DEFAULT_DIR = "/";
         * Default directory to serve files from on Windows.
        //protected static String DEFAULT_WIN_DIR = "C:\\";
        protected static String DEFAULT_WIN_DIR = "k:\\opencyc\\run\\httpd\\htdocs";
         * File cache capacity.
        protected static final int CACHE_CAPACITY = 100;
         * File cache to improve file serving performance.
        protected static Hashtable fileCache = new Hashtable(CACHE_CAPACITY);
         * Number of files served from this web server.
        protected static long nbrFilesServed = 0;
         * Number of files served from this web server that were found in the cache.
        protected static long nbrCacheHits = 0;
         * Server socket for accepting connections.
        protected ServerSocket server;
         * Directories to serve files from.
        protected ArrayList dirs;
         * Map from String (jar root) to JarFile[] (jar class path).
        protected HashMap map;
         * Webserver HTTP port.
        protected int port;
         * Cyc HTML host.
        protected String cycHost = "localhost";
         * Cyc HTML port.
        protected int cycPort;
         * Expand jar tress.
        protected boolean trees;
         * Requests flag.
        protected boolean traceRequests;
         * Constructs a WebServer object.
         * @param port the port to use
         * @param directories the directory to serve files from
         * @param trees true if files within jar files should be served up
         * @param traceRequests true if client's request text should be logged.
         * @exception IOException if the listening socket cannot be opened, or problem opening jar files.
        public WebServer() throws IOException {
            getProperties();
            server = new ServerSocket(port);
            processDirectories();
         * Class Task processes a single HTTP request.
        protected class Task extends Thread {
             * Socket for the incoming request.
            protected Socket sock;
             * Client socket to the Cyc KB HTML server.
            protected Socket cycHtmlSocket;
             * Output tcp stream.
            protected DataOutputStream out;
             * Contains the file request path for a not-found error message.
            protected String notFoundPath;
             * Contains the first line of a request message.
            protected String methodLine;
             * Contains the body of a POST method.
            protected String bodyLine;
             * Constructs a Task object.
             * @param sock the socket assigned for this request.
            public Task(Socket sock) {
                this.sock = sock;
             * Processes the HTTP request.
            public void run() {
                if (traceRequests)
                    Log.current.println("connection accepted from " + sock.getInetAddress());
                notFoundPath = "";
                try {
                    out = new DataOutputStream(sock.getOutputStream());
                    try {
                        getBytes();
                    catch (Exception e) {
                        Log.current.println("file not found: " + notFoundPath);
                        try {
                            out.writeBytes("HTTP/1.1 404 Not Found\r\n");
                            out.writeBytes("Server: Cyc WebServer\r\n");
                            out.writeBytes("Connection: close\r\n");
                            out.writeBytes("Content-Type: text/html\r\n\r\n");
                            out.writeBytes("<HTML><HEAD>\n");
                            out.writeBytes("<TITLE>404 Not Found</TITLE>\n");
                            out.writeBytes("</HEAD><BODY>\n");
                            out.writeBytes("<H1>404 - Not Found</H1>\n");
                            out.writeBytes("</BODY></HTML>");
                            out.flush();
                        catch (SocketException se) {
                catch (Exception e) {
                    Log.current.printStackTrace(e);
                finally {
                    try {
                        sock.close();
                    catch (IOException e) {
             * Reads the HTTP request and obtains the response.
             * @exception IOException when HTTP request has an invalid format.
            private void getBytes() throws IOException {
                // Below logic is complex because web browsers do not close the
                // socket after sending the request, so must parse message to find
                // the end.
                BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                ArrayList inBytes = new ArrayList(200);
                int ch = 0;
                boolean postMethod;
                methodLine = in.readLine();
                //if (traceRequests)
                //    Log.current.println("methodLine=" + methodLine);
                bodyLine = "";
                if (methodLine.startsWith("POST /"))
                    postMethod = true;
                else
                    postMethod = false;
                //if (traceRequests)
                //    Log.current.println("postMethod=" + postMethod);
                int ch1 = -1;
                int ch2 = -1;
                int ch3 = -1;
                int ch4 = -1;
                // Read the HTTP request headers.
                while (true) {
                    ch = in.read();
                    inBytes.add(new Integer(ch));
                    ch1 = ch2;
                    ch2 = ch3;
                    ch3 = ch4;
                    ch4 = ch;
                    if (ch1 == '\r' && ch2 == '\n' && ch3 == '\r' && ch4 == '\n')
                        break;
                    if ((! postMethod) &&
                        (! in.ready()) &&
                        ch1 == -1 &&
                        ch2 == -1 &&
                        ch3 == '\r' &&
                        ch4 == '\n') {
                        inBytes.add(new Integer('\r'));
                        inBytes.add(new Integer('\n'));
                        break;
                byte[] byteArray = new byte[inBytes.size()];
                for (int i = 0; i < inBytes.size(); i++) {
                    Integer ich = (Integer) inBytes.get(i);
                    byteArray[i] = ich.byteValue();
                String headers = new String(byteArray);
                if (postMethod) {
                    String lcHeaders = headers.toLowerCase();
                    int i = lcHeaders.indexOf("content-length: ");
                    String contentLength = lcHeaders.substring(i + 16);
                    int j = contentLength.indexOf("\r\n");
                    contentLength = contentLength.substring(0, j);
                    int bodyLen = (new Integer(contentLength)).intValue();
                    for (int k = 0; k < bodyLen; k++) {
                        bodyLine = bodyLine + (new Character((char) in.read())).toString();
                String line = methodLine + "\r\n" + headers + bodyLine;
                if (traceRequests)
                    Log.current.println(line);
                if (postMethod)
                    processHttpPost();
                else
                    if (line.startsWith("GET /"))
                        processHttpGet(line.substring(4));
                    else {
                        Log.current.println("Invalid request = " + line);
                        throw new IOException();
             * Processes an HTTP GET method.
             * @param httpGetPath the path of the file to get.
             * @exception IOException if the file is not found.
            private void processHttpGet(String httpGetPath) throws IOException {
                int i = httpGetPath.indexOf(' ');
                if (i > 0)
                    httpGetPath = httpGetPath.substring(0, i);
                Log.current.println(methodLine + " from " + sock.getInetAddress().getHostName());
                i = httpGetPath.indexOf("cg?");
                if (i > 0) {
                    cycHtmlRequest(httpGetPath.substring(i + 3));
                    return;
                notFoundPath = httpGetPath;
                i = httpGetPath.indexOf('/');
                if (i < 0 || map == null) {
                    if (map == null || httpGetPath.endsWith(".jar")) {
                        for (int j = 0; j < dirs.size(); j++) {
                            String dir = (String) dirs.get(j);
                            String nativePath = dir + httpGetPath;
                            nativePath = nativePath.replace('/', File.separatorChar);
                            if (fileCache.containsKey(nativePath)) {
                                writeDataBytes((byte[]) fileCache.get(nativePath));
                                Log.current.println("...cached");
                                nbrCacheHits++;
                                nbrFilesServed++;
                                return;
                            try {
                                File f = new File(nativePath);
                                byte[] fileBytes = getBytes(new FileInputStream(f), f.length());
                                writeDataBytes(fileBytes);
                                if (fileCache.size() >= CACHE_CAPACITY)
                                    fileCache.clear();
                                fileCache.put(nativePath, fileBytes);
                                Log.current.println("...from " + nativePath);
                                nbrFilesServed++;
                                return;
                            catch (IOException e) {
                    throw new IOException();
                String jar = httpGetPath.substring(0, i);
                httpGetPath = httpGetPath.substring(i + 1);
                JarFile[] jfs = (JarFile[]) map.get(jar);
                if (jfs == null)
                    throw new IOException();
                for (i = 0; i < jfs.length; i++) {
                    JarEntry je = jfs.getJarEntry(httpGetPath);
    if (je == null)
    continue;
    writeDataBytes(getBytes(jfs[i].getInputStream(je), je.getSize()));
    nbrFilesServed++;
    return;
    throw new IOException();
    * Processes an HTTP POST method.
    * @exception IOException if the file is not found.
    private void processHttpPost() throws IOException {
    Log.current.println("POST " + bodyLine + " from " + sock.getInetAddress().getHostName());
    cycHtmlRequest(bodyLine);
    * Reads the specified number of bytes and always close the stream.
    * @param in the file to be read for subsequent downloading.
    * @param length the number of bytes to read from the file.
    * @return An array of bytes from the file.
    * @exception IOException if an error occurs when processing the file.
    private byte[] getBytes(InputStream in, long length) throws IOException {
    DataInputStream din = new DataInputStream(in);
    byte[] bytes = new byte[ (int) length];
    try {
    din.readFully(bytes);
    finally {
    din.close();
    return bytes;
    * Sends the HTML request to Cyc.
    * @param cycPath the portion of the URL which is given to the Cyc HTML server.
    private void cycHtmlRequest(String cycPath) {
    String request = sock.getInetAddress().getHostName() + "&" + cycPath + "#";
    System.out.println("request=" + request);
    ArrayList bytes = new ArrayList(10000);
    try {
    cycHtmlSocket = new Socket(cycHost, cycPort);
    System.out.println("cycHost=" + cycHost + " cycPort=" + cycPort);
    BufferedReader cycIn = new BufferedReader(new InputStreamReader(cycHtmlSocket.getInputStream()));
    PrintWriter cycOut = new PrintWriter(cycHtmlSocket.getOutputStream(), true);
    cycOut.println(request);
    cycOut.flush();
    int ch = 0;
    while (ch >= 0) {
    ch = cycIn.read();
    bytes.add(new Integer(ch));
    catch (Exception e) {
    Log.current.printStackTrace(e);
    byte[] byteArray = new byte[bytes.size()];
    for (int i = 0; i < bytes.size() - 1; i++) {
    Integer ich = (Integer) bytes.get(i);
    byteArray[i] = ich.byteValue();
    try {
    writeTextBytes(byteArray);
    catch (Exception e) {
    Log.current.println(e.getMessage());
    * Responds to the HTTP client with data content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeDataBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    String prefix = (new String(bytes)).toLowerCase();
    if (prefix.indexOf("<html>") > -1)
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    else
    out.writeBytes("Content-Type: application/java\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Respond to the HTTP client with text content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeTextBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Gets properties governing the web server's behavior.
    private void getProperties() {
    port = DEFAULT_PORT;
    String portProperty = System.getProperty("org.opencyc.webserver.port", "");
    if (! portProperty.equalsIgnoreCase(""))
    port = (new Integer(portProperty)).intValue();
    Log.current.println("Listening on port " + port);
    cycPort = DEFAULT_CYC_PORT;
    String cycPortProperty = System.getProperty("org.opencyc.webserver.cycPort", "");
    if (! cycPortProperty.equalsIgnoreCase(""))
    cycPort = (new Integer(cycPortProperty)).intValue();
    Log.current.println("Cyc connections directed to port " + cycPort);
    String dirsProperty = System.getProperty("org.opencyc.webserver.dirs", "");
    dirs = new ArrayList(3);
    StringTokenizer st = new StringTokenizer(dirsProperty, ";", false);
    while (st.hasMoreTokens()) {
    String dir = st.nextToken();
    dirs.add(dir);
    trees = false;
    String treesProperty = System.getProperty("org.opencyc.webserver.trees", "");
    if (! treesProperty.equalsIgnoreCase(""))
    trees = true;
    traceRequests = false;
    String traceRequestsProperty = System.getProperty("org.opencyc.webserver.traceRequests", "");
    if (! traceRequestsProperty.equalsIgnoreCase("")) {
    traceRequests = true;
    Log.current.println("tracing requests");
    * Adds transitive Class-Path jars to jfs.
    * @param jar the jar file
    * @param jfs the list of jar files to serve.
    * @param dir the jar file directory.
    * @exception IOException if an I/O error has occurred with the jar file.
    private void addJar(String jar, ArrayList jfs, String dir) throws IOException {
    Log.current.println("Serving jar files from: " + dir + jar);
    JarFile jf = new JarFile(dir + jar);
    jfs.add(jf);
    Manifest man = jf.getManifest();
    if (man == null)
    return;
    Attributes attrs = man.getMainAttributes();
    if (attrs == null)
    return;
    String val = attrs.getValue(Attributes.Name.CLASS_PATH);
    if (val == null)
    return;
    dir = dir + jar.substring(0, jar.lastIndexOf(File.separatorChar) + 1);
    StringTokenizer st = new StringTokenizer(val);
    while (st.hasMoreTokens()) {
    addJar(st.nextToken().replace('/', File.separatorChar), jfs, dir);
    * Administrative accessor method that obtains list of directories from which files are served.
    public ArrayList getDirs() {
    return dirs;
    * Administrative method that updates the list of directories from which files are served.
    public synchronized void setDirs(ArrayList dirs) throws IOException {
    this.dirs = dirs;
    fileCache.clear();
    processDirectories();
    * Administrative accessor method that obtains number of files served.
    * @return The number of files served.
    public long getNbrFilesServed() {
    return nbrFilesServed;
    * Administrative accessor method that obtains number of files served from cache.
    * @return The number of files served from the cache.
    public long getNbrCacheHits() {
    return nbrCacheHits;
    * Administrative method that clears the file cache.
    public synchronized void clearFileCache() {
    Log.current.println("Clearing file cache");
    fileCache.clear();
    nbrFilesServed = 0;
    nbrCacheHits = 0;
    * Processes the directories from which files are served, expanding jar trees if
    * directed.
    * @exception IOException if problem occurs while processing the jar files.
    private void processDirectories() throws IOException {
    if (dirs.size() == 0)
    if (File.separatorChar == '\\')
    dirs.add(DEFAULT_WIN_DIR);
    else
    dirs.add(DEFAULT_DIR);
    Iterator directories = dirs.iterator();
    while (directories.hasNext())
    Log.current.println("Serving from " + directories.next());
    if (trees) {
    map = new HashMap();
    for (int j = 0; j < dirs.size(); j++) {
    String dir = (String) dirs.get(j);
    String[] files = new File(dir).list();
    for (int i = 0; i < files.length; i++) {
    String jar = files[i];
    if (!jar.endsWith(".jar"))
    continue;
    ArrayList jfs = new ArrayList(1);
    addJar(jar, jfs, dir);
    map.put(jar.substring(0, jar.length() - 4), jfs.toArray(new JarFile[jfs.size()]));
    * Provides the command line interface for creating an HTTP server.
    * The properties are:
    * <pre>
    * org.opencyc.webserver.port=<HTTP listening port>
    * </pre>
    * which defaults to 80.
    * <pre>
    * org.opencyc.webserver.cycPort=<Cyc connection port>
    * </pre>
    * which defaults to 3600.
    * <pre>
    * org.opencyc.webserver.dirs=<path>;<path> ... ;<path>
    * </pre>
    * with the argument enclosed in quotes if any path contains an
    * embedded space.
    * The default directory on Windows is C:
    * and the default on other systems is / the default
    * can be overridden with this property. By default, all files
    * under this directory (including all subdirectories) are served
    * up via HTTP. If the pathname of a file is <var>path</var> relative
    * to the top-level directory, then the file can be downloaded using
    * the URL
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>path</var>
    * </pre>
    * Caching of file contents is performed.
    * <pre>
    * org.opencyc.util.log=all
    * </pre>
    * If the all value is given, then all attempts to download files
    * are output.
    * <pre>
    * org.opencyc.webserver.traceRequests
    * </pre>
    * If this property has any value, then the client HTTP requests are
    * output.<p>
    * <pre>
    * org.opencyc.webserver.trees
    * </pre>
    * This property can be used to serve up individual files stored
    * within jar files in addition to the files that are served up by
    * default. If the property has any value, the server finds all jar files
    * in the top-level directory (not in subdirectories). For each
    * jar file, if the name of the jar file is <var>name</var>.jar, then any
    * individual file named <var>file</var> within that jar file (or within
    * the jar or zip files referenced transitively in the Class-Path manifest
    * attribute, can be downloaded using a URL of the form:
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>name</var>/<var>file</var>
    * </pre>
    * When this property has any value, an open file descriptor and cached
    * information are held for each jar file, for the life of the process.
    * @param args an unused array of command line arguments.
    public static void main(String[] args) {
    Log.makeLog();
    System.out.println("OpenCyc Web Server");
    try {
    // Launch thread to accept HTTP connections.
    current = new WebServer();
    current.start();
    catch (IOException e) {
    e.printStackTrace();
    * Just keep looping, spawning a new thread for each incoming request.
    public void run() {
    try {
    while (true) {
    // Launch thread to process one HTTP request.
    new Task(server.accept()).start();
    catch (IOException e) {
    e.printStackTrace();

    JLundan,
    I want to thank you for responding to the thread I started on the forum at java.sun.com. Your solution to my problem of needing to print the code of the html pages that the file I included generates was just what I was looking for. However, I have some further questions to ask, if you don't mind. To clarify my task I should say that your rephrasing of the problem is accurate: "You wan't to display the contents of the HTML file that the web server produces in response of client's request?"
    Yes, this is what I need to do, but also it needs to display the source code of that html file that the server produces in response to the client's request. Also, in this case, I am the client requesting that the server return some html file, and I'm not sure where the server is. But the webserver.java file that I shared on the forum is on my local machine. I was wondering if I could modify this webserver.java file at my home so that any html file the server returns to me would automatically display the source code. This is a school project of mine and I am stuck on this one thing here.
    Further, where would I put the "foo.html" file so it can be written to?
    FileOuputStream fos = new FileOutputStream("foo.html");
    fos.write(bytes);
    fos.close();
    Thanks so much for your help. I look forward to your response, at your convenience.
    Regards

Maybe you are looking for

  • Error during installing BOXI-R2 on Windows 64 Bit with Oracle.

    I am facing these issues while installing BOXI-R2 : Environment: OS: MS Windows XP Professional x64 Edition Version 2003 u2013 Service Pack 2 Oracle: 10.2.0.1.0 64 bit for Windows XP BO: BOXI-R2 Service Pack 4 - Server Installation with Tomcat. CMS &

  • Trying to install Flash 11.5 on Mac OS X 10.6.8. Install completes but Flash does not work - any help?

    Hi, I was told I didn't have Flash 7 when trying to see something online (which I am sure was incorrent to begin with) so I followed the provided link to download Flash version 11.5. The download completed without problems but Flash doesn't seem to w

  • Aco  implemenataion for shortest paths.

    has anyone used ant colony optimization algorithm for finding shortest paths other than for the tsp? please i need some help and advice. thanks

  • Finder Very Slow - Folders with Many Files

    I've recently noticed that whenever I use Finder to access folders that contain a large number of files (100 or more files in a folder)... it seems to take an inordinately long time for the files to be displayed. Being relatively new to the Mac world

  • Flash forms, dynamic content

    I am relatively new to assembling Flash Forms. I am trying to build a form that lists departments in a dropdown on one tab and will then display a list of items and checkboxes that apply to the department that is selected on another tab. I am using c