GWCheck repetitive 'CODE 93 unused blob files (deleted)

I've run the standalone gwcheck a few times now. with 'contents+attachment file check' and Fix problems.
I've run it on user/message.
It seems to me that it keeps reporting the same message after every run, I get
Correctable conditions encountered:
CODE DESCRIPTON COUNT
93 Unused blob files (deleted)..................583
It keeps reporting the same count, 583 files.
It also reports
Uncorrectable conditions encountered:
CODE DESCRIPTON COUNT
50 Unused blob files (deleted)..................18
Any idea on how to correct it?

Originally Posted by fribert
I've run the standalone gwcheck a few times now. with 'contents+attachment file check' and Fix problems.
93 Unused blob files (deleted)..................583
It keeps reporting the same count, 583 files.
50 Unused blob files (deleted)..................18
Any idea on how to correct it?
In the details above it should show the folder and BLOB file(s) it wants to delete as it crawls through the message databases. You can check to see if they actually exist. IF it is not deleting them, there is usually a reason, like they are too recent to delete, they are help open, or the options actually in effect do not allow it to repair. In the beginning of the GWCHECK log, it will show the options, and the start / end time of the run.
I'm wondering if you are seeing the same GWCHECK log over and over, so check the start / end times to ensure its not just regurgitating the same log.
-- Bob

Similar Messages

  • Cleanup Wizard shows no unused content files deleted

    WINDOWS 2008 SERVER / wsus Server Version 3.2.7600.251 / I've run the Wizard several times over the past couple of weeks and it never deleted any unused content files / doesn't seem right  ....any ideas?

    WINDOWS 2008 SERVER / wsus Server Version 3.2.7600.251 / I've run the Wizard several times over the past couple of weeks and it never deleted any unused content files / doesn't seem right  ....any ideas?
    Yep. You need to do update approval maintenance first.
    See
    Removing unneeded update approvals for additional info.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • How to delete unused audio files in a project?

    Hi guys,
    The question is fairly simple:
    How to delete unused audio files in a project?
    I can't manage to find the answer in the manual,... all I could find is how to delete audio outside used regions!
    But in the projects I use, I have loads of outtakes which I don't use in the project anymore, and now, I would like to delete them of the audio folder to save space on the HD.
    Can Logic select automatically the takes in the audio files folder which are not used in the project and delete them??
    Because there is hundreds of audio files per project, and +/- 50 projects, I just can't do it manually.
    Thanks,
    Fred

    Whoops! Yes, I knew that but a cow flew by... Sorry!
    The procedure I follow is to do what I described then Save as Project, creating a project folder. That way only the required audio is saved to the folder and I delete all temporary stuff. However, if you have folders with shared material, it's much harder and would require you to go through all your projects doing Save as Project before you could delete your old working folder.
    When doing day to day work, best practice is to create a new folder and only use Save as Project when you're working on stuff. Shared material (eg sample libraries etc) can go elsewhere and you can get Logic to copy those to the project folder automatically.
    Otherwise, Shift-Backspace in the Audio window, as you rightly say
    Pete

  • Archive BLOB File Recovery

    I managed to not only erase the Archive folder for a user, but also the backup of the Archive folder. Recovered the Archive folder with a disk utility, but now when I try to access archives, I see the list of emails. However, upon selecting any of them, I get "Error c04f" Block checksum error. I've tried running GWCheck but it ends up deleting all the blob files saying they are invalid or not referenced. Is there a way to re-read those blob files into the message database, or am I out of luck.
    Thanks ahead for any ideas, suggestions.

    Hi,
    It could be a corrupt ngwguard.db file. You could try the following, but only do this on a backup in case it makes things worse:
    Recreate the guardian database:
    1. Rename the archive directory.
    2. Login to GW client, archive a message. This will recreate the archive directory, ngwguard.db, user.db, msg.db files.
    3. Copy the NGWGUARD.DB ONLY from the new archive directory to the renamed archive directory.
    4. Rename the archive directory back to its original name (delete the new directory).
    5. Perform a structure check on the archive. It should run clean.
    6. Login to GW client, open archive.
    Let us know how it goes.
    Cheers,

  • File.delete() and File.deleteOnExit() doesn't work consistently..

    I am seeing some odd behavior with trying to delete files that were opened. Usually just doing new File("file.txt").delete() would work. However, in this case, I have created an input stream to the file, read it in, saved it to another location (copied it), and now I am trying to delete it.
    The odd thing is, in my simple application, the user can work with one file at a time, but I move "processed" files to a lower pane in a swing app. When they exit it, it then archives all the files in that lower pane. Usually every file but the last one opened deletes. However, I have seen odd behavior where by some files don't delete, sometimes all of them wont delete. I tried the deleteOnExit() call which to me should be done by the JVM after it has released all objects such that they don't matter and the JVM ignores any object refs and directly makes a call (through JNI perhaps) to the underlying OS to delete the file. This doesn't work either.
    I am at a loss as to why sometimes some files delete, and other times they don't. In my processing code, I always close the input stream and set its variable to null. So I am not sure how it is possible a reference could still be held to the object representing the file on disk.

    and then, in the other class
      public int cdplayerINIToMMCD(File aDatabase, String thePassword) throws IllegalArgumentException {
         /*---------DATA---------*/
         String dbLogin, dbPassword;
         JFileChooser fc;
         INIFileFilter ff;
         int dialogReturnVal;
         String nameChosen;
         File INIFile;
         ProgressMonitor progressMonitor;
         BufferedReader inFileStream;
         String oneLine;
         int totalLines = 0;
         int linesParsed = 0;
         boolean openDBResult;
         int hasPassword;
         if ((aDatabase == null) || (!aDatabase.exists()) ||
            (FileManagement.verifyMMCD(aDatabase) == FileManagement.VERIFY_FAILED)) {
            throw new IllegalArgumentException();       
         else { 
            currentDB = aDatabase;
            if(thePassword == null) {
              dbPassword = "";
            else { dbPassword = thePassword; }
            dbLogin = dbPassword; //For MSAccess dbLogin == dbPassword
         //Ask the user for the cdplayer.ini file.
         //Create a file chooser
         if (System.getProperty("os.name").indexOf("Windows") > -1) {
            fc = new JFileChooser("C:\\Windows");
         else {
            fc = new JFileChooser();     
         fc.setMultiSelectionEnabled(false);
         fc.setDragEnabled(false);
         //Create a new FileFilter
         ff = new INIFileFilter();
         //Add this filter to our File chooser.
         fc.addChoosableFileFilter(ff);
         fc.setFileFilter(ff);
         //Ask the user to locate it.
         do {
            dialogReturnVal = fc.showOpenDialog(mainFrame);
            if (dialogReturnVal == JFileChooser.APPROVE_OPTION) {
               nameChosen = fc.getSelectedFile().getAbsolutePath();
               if(nameChosen.toLowerCase().endsWith(INIFileFilter.FILE_TYPE)) { INIFile=new File(nameChosen); }
               else { INIFile = new File(nameChosen+INIFileFilter.FILE_TYPE); }
               if (!INIFile.exists()) {
                  continue; //If the name specified does not exist, ask again.
               else { break; }
            else { //User clicked cancel in the open dialog.
               //Ignore what we've done so far.
               return(IMPORT_ABORTED);
         } while(true); //Keep asking until cancelled or a valid file is specified.
         //Determine how many lines will be parsed.
         try {
           //Open the INI for counting
           inFileStream = new BufferedReader(new InputStreamReader(new FileInputStream(INIFile)));
           while ((inFileStream.readLine()) != null) {
               totalLines++;
           //Close the INI file.
           inFileStream.close();
         } catch (IOException ex) { return(IMPORT_FAILED); }
         //Make a progress monitor that will show progress while importing.
         progressMonitor = new ProgressMonitor(mainFrame, "Importing file","", 0, totalLines);
         progressMonitor.setProgress(0);
         progressMonitor.setMillisToPopup(100);
         progressMonitor.setMillisToDecideToPopup(1);
         //Make our DatabaseHandler to insert results to the database.
         dbh = new DatabaseHandler();
         //Open the database connection.
         do {
           try {
              openDBResult = dbh.openDBConnection(currentDB, dbLogin, dbPassword);
           } catch(JDBCException ex) { return(IMPORT_JDBC_ERROR); } //OUCH! can't write anything.
             catch(SQLException ex) {
                 openDBResult = DatabaseHandler.OPNCN_FAILED;
                 //Can not open the database. Is it password protected?
                 hasPassword = JOptionPane.showConfirmDialog(mainFrame, "Could not open the database. "+
                                                "The password is wrong or you have not specified it.\n"+
                           "Do you want to enter one now?", "New password?", JOptionPane.YES_NO_OPTION);
                if (hasPassword == MMCDCatalog.DLG_OPTN_YES) {
                   dbPassword = JOptionPane.showInputDialog(mainFrame, "Please enter your "+
                                                              "password for the DataBase:");
                    dbLogin = dbPassword; //For MSAccess, login == password                                                    
                //If the password wasn't the problem, then we can't help it.
                else { return(IMPORT_FAILED); }
         } while(openDBResult != DatabaseHandler.OPNCN_OK); //If it is OK, no exception thrown.
         //Import the ini file
         try {
            //Open the INI file for parsing.
            inFileStream = new BufferedReader(new InputStreamReader(new FileInputStream(INIFile)));
            //Read and parse the INI file. Save entries once parsed.
            while ((oneLine = inFileStream.readLine()) != null) {
               parseLine(oneLine);
               linesParsed++;
               progressMonitor.setNote("Entries imported so far: "+entriesImported);
               progressMonitor.setProgress(linesParsed);
               if ((progressMonitor.isCanceled()) || (linesParsed == progressMonitor.getMaximum())) {
                  progressMonitor.close();
                  break;
            //Close the INI file.
            inFileStream.close();
         } catch (IOException ex) {
              //Make absolutely sure the progressMonitor has disappeared
                progressMonitor.close();
                if (dbh.closeDBConnection() != DatabaseHandler.CLSCN_OK) {
                 JOptionPane.showMessageDialog(mainFrame, "Error while reading the INI file.\n"+
                    "Error while attempting to close the database", "Error", JOptionPane.INFORMATION_MESSAGE);
              else {
                 JOptionPane.showMessageDialog(mainFrame, "Error while reading the INI file.",
                                                    "Error", JOptionPane.INFORMATION_MESSAGE);     
                return(IMPORT_FAILED);
         //Make absolutely sure the progressMonitor has disappeared
         progressMonitor.close();
         //Close the database connection
         if (dbh.closeDBConnection() != DatabaseHandler.CLSCN_OK) {
            JOptionPane.showMessageDialog(mainFrame, "Error while closing the database after import.",
                                          "Error", JOptionPane.INFORMATION_MESSAGE);
         //Did the user cancel?
         if (totalLines != linesParsed) {
            return(IMPORT_ABORTED);     
         //Success!
         //Everything ok. Return the number of entries imported.
         return(entriesImported);
      }

  • File.delete() not working properly

    Hi Forum!!
    I am trying with the below code :
    File file = new file("path");
    try{
    if(file.exists())
    System.+gc+();
    file.delete();
    System.+out+.println("Control in delete trx file after deletion"+ file.exists());
    }catch(SecurityException se){
    String msg= "Delete trx file if 3gttz file created : IO Problems";
    Log.+error+(msg, se);
    }file.exists() returns false But I when I check file, it still exhists with content 0 bytes .
    Is there a way to remove the entire file from the directory rather than deleting only the
    contents ? Need not to tell I did my initial search to solve the problem.
    Thanks
    Edited by: jagabandhu on Feb 10, 2009 1:09 PM

    georgemc wrote:
    PhHein wrote:
    corlettk wrote:
    We can't all be rocket surgeons, either ;-)Heart scientist is the word you're looking for.Or rockin' sturgeons. A (marginally) cooler - albeit fictional - alternative to this abominationFrom a crazy drunk:
    A "bottle in front of me" is better than a "frontal lobotomy"!
    (Sound out those two quoted strings.)

  • 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

  • Display in browser blob files (.doc, .pdf...) stored in the Database

    Hi,
    I want to display blob file from de DB to the browser, but when I click on the link of the document I want to open, nothing append. If I check the length of the file it is correct. I tried to write it in a directory to see what appends. I can only write txt file. The other files are corrupted.
    I did something like in the topik 532271.
    Did I do something wrong ? Do I have to write some code in the web.xml ?
    Here is my code :
    public DataOutputStream showBlob() throws SQLException, IOException{
    //it is my class not those from java.io
    File file = (File) this.getFiles().getRowData();
    FacesContext faces = FacesContext.getCurrentInstance();
    HttpServletResponse resp = (HttpServletResponse)faces.getExternalContext().getResponse();
    Blob b = file.getBlob();
    int len = 0;
    InputStream is = b.getBinaryStream();
    long length = b.length();
    byte[] x = new byte[10240];
    resp.setHeader("Content-Disposition","filename=\"" + file.getFileName() + "\"");
    resp.setContentType(file.getMimeType().getMime());
    resp.setContentLength((int)length);
    DataOutputStream o = new DataOutputStream(resp.getOutputStream());
    while ( (len = is.read(x)) != -1)
    o.write(x, 0, len);
    o.flush();
    o.close();
    is.close();
    faces.responseComplete();
    return o;
    In my xhtml page I have :
    <ice:commandLink id="downloadLink"
    action="#{managerBean.layoutManager.ediTraining.showBlob}"
    value="#{file.fileName}" target="_blank">          
    </ice:commandLink>
    Thank you for your response.
    Edited by: joce77 on Nov 12, 2007 7:39 AM

    Hi BalusC,
    I did what you explant on this page http://balusc.blogspot.com/2007/07/fileservlet.html whit "FileServlet serving from database".
    When I clik on the link I got an empty page with this html code :
    <iframe id="history-frame" src="/uniform/xmlhttp/blank" style="z-index: 10000; visibility: hidden; width: 0pt; height: 0pt; position: absolute; opacity: 0.22;" title="Icefaces Redirect" frameborder="0"></iframe>
    <script id="dynamic-code" language="javascript"></script>
    <script id="focus-code"></script>
    <script id="select-code"></script>
    <script id="click-code"></script>
    <script id="configuration-script" language="javascript">window.session='YXtNt2XZnElULb3t0j_7BQ';
    document.getElementById('configuration-script').parentNode.viewIdentifier=1;
    if (!window.views) window.views = []; window.views.push(1);
    window.configuration = {synchronous: false,redirectURI: null,connection: {context: '/uniform/',timeout: 30000,heartbeat: {interval: 20000,timeout: 3000,retries: 3}}};
    </script>
    Any idea ?
    Thanks

  • File deletion in root and subdirectories.

    Greetings,
    I have a question regarding Batch scripting. I am trying to create a system maintenancing script which removes .TMP and .BAK files from all of my drives both subdirectories and directories above. Let's say the Batch script would be placed into "Folder3"
    in the following internal drive address "C:\Folder1\Folder2\Folder3\Folder4\Folder5". And I want the batch script to remove files from folders 4 and 5 as subdirectories but also to remove files from C: Drive and folders 1, 2, and of course 3 itself
    but without removing folders. And I'd like to apply this method to all drives simultaneously without a human user personally moving the script via cut/copy and pasting from drive to drive. The other alternative which can come into consideration is to create
    a Batch File with any address location on the internal drive and when running this Batch file it'll create additional Batch Files on specified (multiple) drives at the very root of drives in the drive address of C:\ for instance, and initializes the required
    file deletion process. Some of the folders require my Administrator priviliges therefore I'd like to create a code within the script that ask for user permission and says "Yes" but without actually asking from me as the user to click "Ok"
    or "Yes" when running the script itself or to fully bypass the firewall. I have created the other part of the coding for deleting specified superfluous file types and in what way it's just the sub and above-directory part of it that gives me a pause
    to proceed. Any help is greatly welcome or pointers. If my request would seem cluttered please notify me of it and I'll try to simplify it down, although I hope I wasn't too confusing with the elaboration.
    Thank you in advance, even for the consideration.
    Kind Regards.

    @ECHO OFF
    for %%a in (C: D: E: F: G:) do call :Sub %%a
    goto :eof
    :Sub
    echo Processing %1
    del /s /q %1\*.tmp
    del /s /q %1\*.bak

  • Displaying the BLOB files(PDF,TXT,IMAGE,etc) in the Form as an Attachment

    Hi all,
    I need to Open a file which is stored in the Data base Table & the Data type is of BLOB so i am populating the data but i need to display the attachment which is stored in the BLOB file when the button is clicked & i am using Oracle 10g
    I have been just placed a Button & written the below code in WHEN_BUTTON_PRESSED Trigger & i have tried it out by placing a image icon & WHEN_IMAGE_PRESSED but it's not getting worked
    It is Directly Coming in to Exception..
    DECLARE
    vblob BLOB;
    vmime VARCHAR2(30);
    BEGIN
    select attachment,MIME_TYPE into vblob,vmime
    from Table_name_a
    where UNIQUE_ID = 16842;--:ITEM_RESULT.DRAWINGNO;
    htp.init;
    owa_util.mime_header( vmime, false);
    -- owa_util.mime_header( 'image/jpeg', false);
    -- owa_util.mime_header( 'image/jfif', false);
    -- owa_util.mime_header( 'image/gif', false);
    -- owa_util.mime_header( 'application/word' , FALSE);-- to read MS WORD doc
    owa_util.mime_header( 'application/pdf' , FALSE);-- to read ADObE
    message ('attachment type is' ||vmime);
    message ('attachment type is' ||vmime);
    owa_util.http_header_close;
    wpg_docload.download_file(vblob);
    exception
    when no_data_found then
    dbms_output.put_line('1. attachment type is' ||vmime);
    -- NULL;
    end;
    so if any body has any idea Please let me Know
    Hope for the Reply.
    Thanks & Regards
    K Nikethan Reddy

    Hi,
    Thanks for the reply,
    The Document which u Refer is Showing how to Retrieve the Files from the Local System (i.e by giving the path) but i need to populate it from the database.
    K Nikethan Reddy.

  • View Doc (pdf, image, .doc) imported as BLOB files in UIImageView within a UIScrollView.

    Hi,
    I am new to IOS programming and after researching on topic i found post saying it is possible to view BLOB file in uiimageView.
    I have already done sucessfully for BLOB file of Image. but i can not view pdf file, even if i got NSData.
    /****** from SP ****/
    Insert TestBlob(tbName, tbDesc, tbBin) Select
    'Test.pdf','PDF file', BulkColumn from Openrowset( Bulk
    'C:\blob\udoc\81.pdf', Single_Blob) as tb
    /****** from my App *******/
    NSString *strImage; // String has BLOB file from DB
    NSData *imageData = [self dataFromBase64EncodedString:strImage];
    UIImage *image = [UIImage imageWithData:imageData];
    UIImageView *m_oImageViewer = [[UIImageView alloc]init];
    m_oImageViewer.image = image;
    m_oImageViewer.frame=CGRectMake((self.view.frame.size.width/2)- 250,60,500,500);
    [self.view addSubview:m_oImageViewer];
    -(NSData *)dataFromBase64EncodedString:(NSString *)string{
    if (string.length > 0)
         NSString *data64URLString = [NSString stringWithFormat:@"data:;base64,%@", string];
        NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:data64URLString]];
        return data;
    return nil;
    Please help me. i have already viewd Image but PDF comming empty. i do not want to edit or do anything only user should be able to view uploaded Doc from IPD App. and Doc can be image, pdf or .doc or excel sheet. i get BLOB file for all file types which i pass to my App.
    IS what i am doing is correct? as i imagine BLOB is common for all file Types. still i can not see pdf file(i have not tried other file formate only .png and pdf).
    Please guid me if i am missing anything.

    Hi Sreelatha. The best example code for your purpose is the Scrolling sample app I referred to previously. The word Scrolling in that post is a link to the download page. I think that code will answer all your questions about how to init a UIImage, then use it to init a UIImageView, and then position the UIImageView frame in a UIScrollView. Two cases are demostrated: 1) Scrolling horizontally through a series of images; 2) Scrolling both H & V over a single image which is several times larger than the window.
    You might also be interested in the PageControl sample app in case you want to add a page control to your scroll view.
    Reading your last post again... I sure hope we've been discussing images (like jpegs?) in this thread. This isn't about reading and rendering the actual xls, pdf and doc files, is it?? Of course the iPhone handles html beautifully, so for example, an html representation of a doc file would play nicely. But in that case you'd want a UIWebView, not a UIImageView.

  • How to retrieve blob file

    i am having a problem retrieving my blob file(PDF) to display on browser.
    i have this code below:
    $filename = $row['FILENAME'];
    // Call the load() method to get the contents of the LOB
    print $row['BINFILE']->load()."\n";
    header('Content-type:application/pdf');
    //header("Cache-Control: private",false); // required for certain browsers
    header('Content-Disposition: attachment; filename="'.$filename.'"');
    readfile($filename);
    echo $row['BINFILE'];
    this will display some characters when opened at mozilla. when opened on IE, this doesn't display pdf on the browser instead it will only allow to save the file.
    hope anyone can give me some advice n some assistance on this.
    thanks
    Edited by: tamse on Jul 7, 2009 7:16 PM
    Edited by: tamse on Jul 7, 2009 7:19 PM

    I've got an example on my blog that might help, it's using a PNG. You can find it here:
    http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

  • How to read a blob file using dbadapter

    how to read or select a blob file in a table using dbadapter

         public void fileRead(){
                 File aFile =new File("myFile.txt");
             BufferedReader input = null;
             try {
               input = new BufferedReader( new FileReader(aFile) );
               String line = null;
               while (( line = input.readLine()) != null){
             catch (FileNotFoundException ex) {
               ex.printStackTrace();
             catch (IOException ex){
               ex.printStackTrace();
         }This code is to read a text file. But there is no such thing that will convert your text file to xml file. You have to have a defined XML format. Then you can read your data from text files and insert them inside your xml text. Or you may like to read xml tags from text files and insert your own data. The file format of .txt and .xml is far too different.
    cheers
    Mohammed Jubaer Arif.

  • Creating a bitmap from a blob file

    I need help writing PL/SQL procedure (or function) that converts a blob file in an Oracle 8 table to a normal bitmap.
    Can any one help??
    Thanks in advance.
    Rob

    I can help with this if the BLOB is actually a bitmap. IE If you have the BITMAP stored as a blob in an 8i table then Email me at [email protected] and I will send you some code the demonstrates reading a blob and producing a bitmap on the file system.
    Cheers
    Paul

  • Operations on file: Deleting and get size

    Hi,
    I'm triying to delete a file. I use the following code:
    File found = new File (directoryOutputFileWriter+f);
                   boolean deleted = found.delete();But when I execute it the boolean deleted it's always false and the file is not deleted.
    Then I try to get the size of another file in this way:
    File produced = new File(directoryOutputFileWriter+file[0]);
    long size = produced.length();but I receive a null value (the file exists and its dimension is over 0 of course).
    Why?
    How can I solve?
    Thanks, bye bye.

    Hello,
    in my experience the absolute #1 source of astonishment with file operations is loose manual checking (mistyping or misreading).
    I suggest you use those traces:
    File found = new File (directoryOutputFileWriter+f);
    System.out.println("File path is"+found.getAbsolutePath());
    System.out.println("Does this file exists? "+found.exists());
    System.out.println("Is this file really a file? "+found.isFile()); // You may not be able to delete a directory on all platforms
    System.out.println("Is this file deleted now? "+found.delete());#2 is developers not reading the javadoc (that states that delete may not succeed), but I acknowledge you have read it, as you're investigating why it hasn't, and not complaining that it has.
    #3 is people overlooking OS-specific file management. E.g. Unix-Linux-Window file permissions management all may let you read a file but not delete it (with the unices having a richer set of combinations than windows). The rules for directory deletion are different between Unices and Windows. Etc...
    Edited by: jduprez on Jul 5, 2010 9:44 AM
    @Mel: I sometimes wish I was that much connected to my wife's mind ;o)
    @Joachim: nice catch! Loose manual checking indeed (both on my part and on OP's)...

Maybe you are looking for

  • Hp 2000 troublesho​oting

    If I'm using my notebook, if I pick it up, it black screens, then goes to the "safe" screen and I have to restart it. This happens almost every time I pick it up. What is going on. Got it in 2012 and has been doing this for the last couple of month

  • About Receiver JDBC adapter

    Hi experts,   I am getting the purchase order(850), so here i have to update this data(header and item) in two data base tables through JDBC, so how the receiver structure is and how to config that? Regards Ramesh

  • What is the price for calling 0345 numbers

    Could anyone advise what the price is for dialling 0345 numbers, is it the same rate as 01 and 02 geographic numbers

  • Holiday Challenge Time :)

    I have a daily puzzle calendar on my desk and I found a puzzle that I thought may be fun to solve using SQL. Sample Data WITH    matrix AS         SELECT  'A' AS ID, 1 AS A,1 AS B,1 AS C,0 AS D,0 AS E,0 AS F,1 AS G,0 AS H,1 AS I,0 AS J FROM DUAL UNIO

  • G5 Turns off after 10 minutes

    My iMAC G5 just turns off after about 10 minutes. I had trouble with the power supply a few years ago and I replaced it and everything was great. Now it just turns off after about 10 minutes and I am wondering if the power supply is acting up again.