Has any one got any idea why this won't work?

import java.io.*;
import java.util.*;
class VirusScanner
     static String Storedfiles = "c:\\bbb";
     //To change which virus signatures are to be used, the line below must be edited to reflect which directory contains them.
     static String VirusSignatures = "c:\\aaa";
     static int files = 0;
     static int infectedfiles = 0;
static File sig = new File(VirusSignatures);
     static File dir = new File(Storedfiles);
     public static void main(String args[]) throws IOException
          //if file and signature directories are valid, run scan and then display the results of scan.
          if(dir.isDirectory() && sig.isDirectory())
               System.out.println("Scanning Directory: " + dir);
               scanDir(dir);
               System.out.println("Scan of " + dir + " complete. " + files + " files scanned. " + infectedfiles + " infected files found.");
          //otherwise output "Invalid Directory" on the screen
          else
               System.out.println("Invalid Directory");
     public static void scanDir(File direct) throws IOException
          //Create a string array containing a list of all files in the directory
          String s[] = direct.list();
//loop through every file or directory inside current directory
          //and call relevant method
          for (int i=0; i<s.length; i++)
               File current = new File(direct + "/" + s);
               if (current.isDirectory())
                    scanDir(current);
               else
                    scanFile(current);
     public static void scanFile(File filepath) throws IOException
          //Add one to the count of files scanned
files ++;
          // Create filereader object for file to be scanned, and wrap with buffer
          FileReader fr2 = new FileReader (filepath);
          BufferedReader br2 = new BufferedReader(fr2);
          //Create a string containing the contents of the file
int fileInt = (int) filepath.length();
//int fileInt = fileLong.intValue();
char[] buf2 = new char[fileInt];
          br2.read(buf2,0,fileInt);
          String theFile = new String(buf2);
          //Close readers
          fr2.close();
          br2.close();
          //Create a string array containing a list of all of the signature files
          String s[] = sig.list();
          //for loop which checks the contents of each signature file against the file to be checked
          for(int i=1;i<s.length;i++)
               //Create filereader object for relevant virus signature and wrap with buffer
File sigFile = new File (VirusSignatures + "/signature" + i);
               FileReader fr = new FileReader (sigFile);
               BufferedReader br = new BufferedReader(fr);
               //Create a string containing the contents of the signature file
int virusInt = (int) filepath.length();
//int virusInt = virusLong.intValue();
char[] buf = new char[virusInt]; // the buffer
               br.read(buf,0,virusInt);
               String theSig = new String(buf);
               //Close readers
               fr.close();
               br.close();
               //If signature is found in file report to screen
               if (theFile.indexOf(theSig)!=-1)
                    System.out.println("Virus " + i + " found in file " + filepath);
                    infectedfiles++;

This topic is apparently indicated as closed here:
http://forum.java.sun.com/thread.jspa?threadID=621169
Not sure why you posted this at all.

Similar Messages

  • Any ideas why this won't work?

    I appreciate all the help this board provides. I've learned a ton coming here as I continue to grow my SQL knowledge.
    I need this query to look at the Work_order table and pull any lines that were closed during the prior day. Then I need it to look at the Stock_Tran table and pulled and lines that had a Date_Trans during the prior day. That will give me the work completed and the work that was partially completed during the prior day.
    I'm getting an error message at the line I've underlined and bolded that work_order.partno is an invalid identifier (I'm sure that's not the only error). The query worked until I started adding the Stock_Tran table.
    Any ideas would be greatly appreciated!!!
    SELECT
    SITECODE
    , WORK_ORDER_NUMBER AS "WO #"
    , partno
    , WO_PRIORITY AS "PRIORITY"
    , QTY_WORK_ORDER
    , QTY_FINISHED
    , TRUNC(WO_RELEASE_DATE) AS "RELEASE DATE"
    , TRUNC(WO_START_DATE) AS "START DATE"
    , TRUNC(WO_CLOSED_DATE) AS "CLOSED DATE"
    , STOCK_TRAN.QTY_CHANGE
    FROM
    WORK_ORDER
    , (SELECT SUM(QTY_CHANGE) AS "QTY WORKED" FROM STOCK_TRAN
    WHERE
    SITECODE = 'FCI'
    AND STOCK_TRAN_CODE = 'P'
    AND DATE_TRAN = TRUNC(SYSDATE - 1)
    AND WORK_ORDER.SITECODE = STOCK_TRAN.SITECODE
    AND WORK_ORDER.PARTNO = STOCK_TRAN.PARTNO)_
    WHERE
    WORK_ORDER_TYPE = 'K'
    AND SITECODE = 'FCI'
    AND (TRUNC(WO_CLOSED_DATE) = TRUNC(SYSDATE - 1) OR STOCK_TRAN.DATE_TRAN = TRUNC(SYSDATE -1) )
    AND QTY_FINISHED >0
    ORDER BY WO_PRIORITY DESC

    Hi,
    847497 wrote:
    That gets me closer! Thanks. Now I've getting an error at the line highlighted below.
    Here's the error I'm getting: ORA-00904: "STOCK"."QTY_CHANGE": invalid identifier
    SELECT
    SITECODE
    , WORK_ORDER_NUMBER AS "WO #"
    , partno
    , WO_PRIORITY AS "PRIORITY"
    , QTY_WORK_ORDER
    , QTY_FINISHED
    , TRUNC(WO_RELEASE_DATE) AS "RELEASE DATE"
    , TRUNC(WO_START_DATE) AS "START DATE"
    , TRUNC(WO_CLOSED_DATE) AS "CLOSED DATE"
    *  , STOCK.QTYCHANGE*_I assume you mean this is the line where the error message points. It would be better to mark it with a comment, like this:
    ,       STOCK.QTY_CHANGE                  -- *****  ORA-00904 occurs here *****  FROM
    WORK_ORDER
    , (SELECT SUM(QTY_CHANGE) AS "QTY WORKED"
    , sitecode
    , partno
    , date_tran
    FROM STOCK_TRAN
    WHERE SITECODE = 'FCI'
    AND STOCK_TRAN_CODE = 'P'
    AND DATE_TRAN = TRUNC(SYSDATE - 1)
    GROUP BY sitecode, partno ) stockThe only columns in the stock "table" (it's acutally an in-line view) are "QTY WORKED", SITECODE, PARTNO amnd DATE_TRAN.
    If QTY_CHANGE is a column in the STOCK_TRAN table, then yiou can include it in the SELECT clause of the in-line view, and that will allow you to use it in the main query.
    WHERE stock.sitecode = work_order.sitecode
    AND stock.partno = work_order.partno
    AND WORK_ORDER_TYPE = 'K'
    AND work_order.SITECODE = 'FCI'
    AND (TRUNC(WO_CLOSED_DATE) = TRUNC(SYSDATE - 1) OR STOCK.DATE_TRAN = TRUNC(SYSDATE -1) )
    AND QTY_FINISHED >0
    ORDER BY WO_PRIORITY DESC

  • IE6/CSS browser issue- any idea why this is not working?

    http://www.wilmerdds.com/test/index.htm
    If you look at the left column, you will see a black box.  It shouldn't be black. it should match the bg color of the column.  Any idea why this is happening?

    Hi
    The problem is that you are using a png, and IE6 does not support png transparency. You could try using the iepngfix from - http://www.twinhelix.com/css/iepngfix/.
    PZ

  • Any Ideas Why Workspace Won't Work?

    Okay, so it's been bugging me too long to simply continue ignoring the problem... and even still after updating all of the CS6 applications, the problem of the Workspace always being messed up every time I launch CS6 Photoshop 13.0.1 x64 Extended on my Win 7 64-bit machine persists. Any suggestions will be appreciated.
    To help communicate the problem and better understand it, I've prepared this series of screen captures.
    The two Workspaces used in these experiments were 1) VKB's Workspace, a preexisting Saved workspace and 2) Essentials, the preexisting workspace defined by Adobe.
    The experiments consisted of launching the application, observing that the workspace was messed up (Exhibits A, C, D and E), then Resetting the Workspace, closing the application and then opening it again.
    During the course of these experiments I updated the (3) CS6 applications that the updater indicated had available updates, one of which was PS. The announcement on the page (http://forums.adobe.com/community/photoshop/general) indicated 13.0.1.1 was available, but after updates were install, PS reports what I thought I remembered seeing earlier; i.e., 13.0.1 (and not 13.0.1.1). Restarted the system, system would not shut down, would not restart, no video signal, had to give it the finger and force hard restart. Launched PS app, did another check for updates - all apps up to date.
    Began experiments anew - nothing different - Workspace still doesn't work like it always had behaved up until when this issue first presented... maybe a month or three weeks ago - not really sure exactly when.
    The Resetting was done from both the menu Window, Workspace, Reset route and the afforded pull down option (upper right corner).
    Additionally, during the experiments I created a new workspace, also named VKB's Workspace, replaced the earlier one, more experiments, more of the same problem.

    Any ideas will be appreciated.
    Thanks!
    Kelly

  • Any idea why Preview won't work for opening PDF files with this OS?

    For some reason, after the last update to Mavericks 10.9.3, any time I attempt to open a PDF using Preview, the file will not open.  No response from the system.  Any recommended solutions?  Thanks in advance!

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
    SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
    View ▹ Show Log List
    from the menu bar at the top of the screen.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Iphoto will not re-install after disappearing during a software update, any ideas why this happened?

    Before i ran the software update i had to iphoto icons in the launch pad, both had exactlly the same content so i just ignored it for a wile till i needed to update my photos, which i was hoping to do after the update.
    However when i restarted both iphoto icons had gone and iphoto seems to have been wiped off my mac completelly, I have got a back up of all my pic and videos so this is not a problem of recovering them.
    i have then tryed to instal iphoto from the app store, resulting in there being a perminant downloading icon making no progress over the last two hours.
    If any body has any idea why this happened and what i can do to provent it happening again as well as getting iphoto back the help wil be much apricated.

    In addition to Larry's questions what software update did you apply? Do you still have an iPhoto Library in your Pictures folder? If you do what happens if you double click on it?
    OT

  • My iphone suddenly died as well. Holding the sleep button and home button together got it going again. Any ideas why this happens?

    my iphone suddenly died as well. Holding the sleep button and home button together got it going again. Any ideas why this happened?

    No, I don't think anyone here would know.
    Mine has done that once or twice.

  • I have attempted to update a few apps and the install has frozen on 'waiting' not allowing me to either access the app or delete it, any idea why this has happened and how do I get around it?

    I have attempted to update a few apps and the install has frozen on 'waiting' not allowing me to either access the app or delete it, any idea why this has happened and how do I get around it?

    See if either of these things works for you. In the future ... Only update one app at a time. Forget that the Update All button even exists. It causes more problems than it does good - IMO.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and then try to update again. Tap one waiting icon only if necessary to start the download stream.

  • Some photos from one day are showing up on my photo stream, and others from that same day are not. Any idea why this might be?

    Took a bunch of photos on vacation one day, and it seems like the first batch from one day are not showing up, but then all of a sudden, the ones from the second half of the day are there. They are not showing up on the photostream on my iPhone on which I took the photos, or on my iPad or in iPhoto on my computer. Any idea why this could be happening? All the other photos I took all week showed up on my Photostream.
    Is there anyway to force these photos into the photostream?
    Thanks! Any help would be appreciated!

    photo stream uploads photos from your photo app when it is connected to wifi and the photo app has been closed correctly.  That may be why your seeing photos pop up on different dates
    http://support.apple.com/kb/HT4486

  • I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

    I have noticed recently that deleted e mail messages do not disappear from the screen.  Instead they turn grey until I switch to another mailbox.  When I return, they are gone.  Any idea why this has started to happen?

  • I use MAIL exclusively. I have a number of Mailboxes set up. My messages will not load on one particular Mailbox on my MacBookair, but do load in that Mailbox on my IOS devices. Any idea why this is happening?

    I use MAIL exclusively. I have a number of Mailboxes set up. My messages will not load on one particular Mailbox on my MacBookair, but do load in that Mailbox on my IOS devices. Any idea why this is happening?

    No idea at all, it might help if you gave more information, what type of mail, who provides it, any error messages etc.

  • The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    It's the 3rd one on Photoshop standard.  As Curt implies, each little icon position has several possibilities you can display, allowing you some customization of your Tools panel.  Click and hold the mouse button to see each of the choices.
    -Noel

  • I have a canon mf5940dn, it is connected via USB to my macbook air, and yet, when i want to print smith, it says the printer is not connected. does anyone has any idea why? is there a guide to do it properly?

    I have a canon printer mf5940dn, it is connected via USB to my macbook air, and yet, when I want to print smth, it says the printer is not connected. does anyone has any idea why? is there a guide to do it properly?

    Hi,
    I am currently replying to this as it shows in the iChat Community.
    I have asked the Hosts to move it to Snow Leopard  (you should not lose contact with it through any email links you get)
    I also don't do Wirelss printing so I can't actaully help either.
    10:01 PM      Friday; July 29, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    My wifi goes down at least once a day and I have to unplug the time capsule and reboot it and then it works fine.  Any idea why this is happening/what I can do to fix it?

    I was having this problem while still using Mavericks -- it started after a Mavericks update last spring.  During the initial Yosemite beta runs over the summer, it seemed to be fixed, but after the official launch in October, I had all sorts of problems keeping connected.  Its gotten a little better, but still happens to at least one of my devices every day.  Weird that we still cannot figure out why the connection keeps dropping on some devices, but not others, and then the next day, one of the devices that didn't disconnect the previous day will disconnect, but the ones that did disconnect, stay connected.  It's just sloppy, poorly written software for technology that isn't working the way it should.  If you turn off Continuity and Handoff on all your devices, you will probably see that everything stays connected.  With those turned off on all devices, TC stayed connected to everything for over a month.  The day I turned Continuity back on, all the problems started again.  It had something to do with the bluetooth version being used, the wifi routine, and Apple's AirPlay technology not quite getting along with each other.

  • My Mac won't read cyrillic in certain files and displays instead weird characters like this: "–í–µ-Ç–µ-Ä –ø-Ä–æ–¥–∏-Ä–∞–µ-Ç –¥–æ –∫–æ-Å-Ç–µ–π." Any ideas why this might be or how I can solve it?

    Yesterday I extracted the subtitles of an MKV file to try and print them. Unfortunately, when I open the .srt file with any text processor, it displays weird characters like the ones included in the title:
    "–û–±—ã–≤–∞—Ç–µ–ª–∏ –ø–µ—á–∞–ª—å–Ω—ã.
    –í–µ—Ç–µ—Ä –ø—Ä–æ–¥–∏—Ä–∞–µ—Ç –¥–æ –∫–æ—Å—Ç–µ–π."
    I thought this had to do with it being an .srt file, but just now I encountered the same problem with an Excel file.
    Any ideas why this might be or suggestions as to how to solve it?
    Thanks in advance,
    Mario

    It looks like an encoding problem.  You should try opening the file in a text editor where you can choose one of the various possible cyrillic encodings (utf-8, koi8-r, iso-8859-5, win-1251, MacCyrillic)

Maybe you are looking for

  • Displaying data in one row for  for 2 tables without relaiton

    I Have 2 tables without any relation and there is a common field and i want to display data like below table refdet 1) refdt----------refbr----refamt----refcat 10-aug-09---10-----34234-----101a 10-aug-009--11----23245-----102a 1-AUG-09----10----455.9

  • My itunes won't open at all and has the Error message (13014)

    PLEASE HELP! I recently upgraded my itunes to the itunes 9. Now it won't open even if i try with the option key, but i may be doing the wrong thing. It won't even open when i reboot my computer. It was doing fine at first , but now it won't let acces

  • I can't get my Mac Pro to recognize my external hard drive

    I recently purcchased a Mac Pro. I have a 15" PowerBook G4 that I still use. About a year a go I purchased a Lacie 500 GB external hard drive and formated it on my PowerBook and transfered about 350 GB of data over a period of time. I know am trying

  • Mac mini running generals painfully slow compared to ibook...

    hi, i have a new mac mini 1.5 solo core with 1gb of ram. Also running it with a 19"monitor. The game seems to run painfully slow when compared to my old ibook with a 1.33ghz processor and 1gb of ram. thanks

  • Tidal Transporter Automation

    We are using Tidal version 5.3.1, we want to automate the process of job migration through Transporter by runing it into batch mode. I have created a job with the help of the information provided in Transporter help however when i am runing that job