How to list directory for required files

private int checkForFile() throws Exception
File dir = new File((String)args.get("D:\\temp");
String[] children = dir.list();
String pattern = "MYFILE(I|E|G|H|N|S|V).dat";
for (int i =0; i < children.length; i++)
if (Pattern.matches(pattern,children))
set.add(children[i]);
String[] arr = (String[])set.toArray(new String[set.size()]);
boolean exists = false;
for(int i=0; i < arr.length; i++)
FNAME = arr[i];
exists = (new File((String)args.get("D:\\temp\\" + FNAME)).exists();
if (exists) { System.out.println("exists");  return 0; } else { return 1; }
I have to check for all matches in the pattern, if any one file is missing it should specify that the file not found.

the pattern string contains 7 possible file names
like MYFILEE.dat, MYFILEG.DAT, MYFILEH.DAT and so on.
I know how to list the directory but I have match for all 7 possible file names. If some file is missing today and Pattern.matches has matched only 6 of them then it should stop continuing and throw file not found message
i hope u understand my requirement

Similar Messages

  • How to change directory for VOD files

    Hello..
    My company has recently asked me to install the Adobe Streaming Server 4.0.  I was wondering if it is possible to have the server software reside on the C: drive, while having my VOD files on seperate D: drive.  The staff here wants to separate the software (server in this instance) from the individual flash video files, so they have set up two drives.  Any suggestions here?  Can this be done, or do the files have to reside inside the VOD folder on the C: drive?

    Hi,
    Thanks for your interest in FMS 4.
    Yes , you can have the FMS installation in the C drive and the media files any where else. Go to the FMS installation directory and to the conf folder under it. There is a fms.ini configuration file where we can edit the settings for the vod folder. Find a variable VOD_DIR which is now pointing to the vod/media folder under FMS. Change it to the location that you would like to have.

  • How to set directory for preview files?

    I have my Media Cache folders set to an external hard drive, but Premiere Pro still continues to create hundreds of rendered preview files in the default location of Users/username/Documents/Adobe/Premiere Pro/8.0/Adobe Premiere Preview Files, filling up my main disk and then crashing when it gets full. Is the preview file folder a separate setting somewhere?
    Mac Pro 5,1, OSX 10.9.4

    I am having a problem with this as well since installing 8.0. PP 7.2.2 and previous versions did not have this issue.
    When I set the Media Cache preferences to store all cache on an external hard drive it will in fact do so with the exception of IMS files which it still puts in the default of C:\Users\USERNAME\AppData\Roaming\Adobe\Common\Media Cache Files.
    Win 7 Pro
    PP CC 2014
    2014.0.1 / 8.0.1

  • Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Trying to install Acrobate 8 Standard on PC with Windows 7, 64 bit. During the installation I was asked to provide "File Adobe PDF.dll for Windows Vista. How can I obtain the required file?

    Nothing in the Acrobat 8.x product family is compatible with Windows 7 (or any contemporary OS).
    The Acrobat 8.x product family passed into End of Support way back -- (November 2011).
    The current release of Acrobat (XI) is compatible in Windows 7.
    Be well...

  • How to write code for save file directory?

    how to write code for save file directory?

    how to find usa timezone code using java swing?
    i have some code help me
    public class ItsInitializer {
    private static boolean s_initialized = false;
    private ItsInitializer() {
    public static synchronized void initialize() {
    if (!s_initialized) {
    // Modifies default time zone, disables Daylight Saving Time.
    TimeZone l_defaultTimeZone = TimeZone.getDefault();
    int l_rawOffset = l_defaultTimeZone.getRawOffset();
    String l_id = l_defaultTimeZone.getID();
    SimpleTimeZone l_simpleTimeZone = new SimpleTimeZone(l_rawOffset,
    l_id,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0);
    TimeZone.setDefault(l_simpleTimeZone);
    s_initialized = true;
    2.
    long timeMillis = ...;
    long time = timeMillis / 1000;
    String seconds = Integer.toString((int)(time % 60));
    String minutes = Integer.toString((int)((time % 3600) / 60));
    String hours = Integer.toString((int)(time / 3600));
    for (int i = 0; i < 2; i++) {
         if (seconds.length() < 2) {
              seconds = "0" + seconds;
         if (minutes.length() < 2) {
              minutes = "0" + minutes;
         if (hours.length() < 2) {
              hours = "0" + hours;
    3.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    5.import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    [ November 23, 2005: Mess
    private Locale locale = Locale.US;
    private static final String[] tzStrings = {
    "America/New_York",
    "America/Chicago",
    "America/Denver",
    "America/Los_Angeles",
    Date now = new Date();
    for ( TimeZone z : zones) {
    DateFormat df = new SimpleDateFormat("K:mm a,z", locale);
    df.setTimeZone(z);
    String result = df.format(now);
    System.out.println(result);
    String date="05/19/2008 04:30 AM (EST)";
                   SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aaa (z)");
                   TimeZone.setDefault(TimeZone.getTimeZone("PST"));
                   long millis = sdf.parse(date).getTime();
                   sdf.setTimeZone(TimeZone.getDefault());
                   System.out.println(sdf.format(new Date(millis)));
    [ November 23, 2005: Mes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to Stage directory for Oracle EBS R12.1.1 on Window Server 2008 ?

    Hi Every Body,
    1- How to Stage directory for Oracle EBS R12.1.1 downloaded from e-delivery.com on Window Server 2008.?
    -- I have download all files from e-delivery and check the md5 and all files are OK.
    I extracted the entire files with winrar program to the same directory and during the unzipping I was notified to replace these files (dvd.label and component.label) and I agreed each time. So >>
    2- Was that a problem ?
    -- I have setup vc++ from VS6 , the sp6, cygwin , ... and set up the active directory and the domain.. and all other requirements.
    BUT when i started the ebs set up it raise the "*Os User and Group Check*" error.
    even if I am the only user and sure I am the Administrator. and also I run this Command to be sure
    C:\>net localgroup administrators and it said that the administrator is one of the administrators group.
    3- Somebody said that I have to change the temp and tmp folder to be on c:\ drive >> might this solve the problem?
    thanks in advance.

    Hi,
    Most of the instructions you have mentioned , already was configured.
    except for the tmp and temp directories.
    And even I changed them from System Properties >> Advanced >>  Environment Variable under User variable for Administrator and System variables , the problem still exist Os User and Group Check .
    I attach the conf_VIS.txt file because I thought it may help.
    http://www.4shared.com/document/1bS6aio5/conf_VIS.html
    Actually I am not sure about the rapid install patch version but I have download the EBS R12 from the following link and I think it contains the recent installer version
    Link >> Oracle E-Business Suite Release 12.1.1 Media Pack for Microsoft Windows (32-bit)
    http://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=11250138
    Note If you still can not open the link just suggest a suitable file hosting and I will upload to you. here I used 4shared and hoped it suits you.

  • Directory for archiving files with errors

    HI ,
    My Scenario is file to RFC Asynch.
    when ever the PI picks file from the source directory that file need to delete from the path and need to be archived to some other patch.
    And if the file has wrong data it need to archive to error archive folder.
    For this I used  Archive processing in filesender adapter and I also used directory for archiving files with errors(for wrong data files).
    Now the files are arching successfully in the given archive folder for successful messages. But the error files (wrong data which are throwing mapping error in MONI) are also archiving in the same archive folder.
    But these error files need to archive in error archive folder.
    How can I achieve this?
    Thanks in Adv..
    Vankadoath.

    you can use raja's logic ..........in addition in second receiver do a simple mapping UDF to delete the file from the SUCCESS folder. otherwise your file will be archived in both the folder success and errror
    see this code.
    DynamicConfiguration conf = (DynamicConfiguration) para.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey keyFileName1 = DynamicConfigurationKey
                   .create("http://sap.com/xi/XI/System/File", "FileName");
                         inputFileName = conf.get(keyFileName1);
      *File f1 = new File("/usr/sap/XX/"+keyFileName1);*
      *boolean success = f1.delete();*
      *if (!success){*
      *System.out.println("Deletion failed.");*
      *System.exit(0);*
      *}else{*
      *System.out.println("File deleted.");*

  • Change default directory for Creative files (such as Media Databa

    I'm using a Zen xtra with WinXP Pro on my company laptop. The Creative software puts a lot of files (7 MB!) in my user profile under Document and Settings. Unfortunately, this is making my profile larger than my company allows, since they back up the profile over the network.
    How can I change the default directory for these file? I can't find any .ini files that might declare the path, and I can't find anything in the Windows Registry that points to my profile.
    Help please?
    Thanks,
    Luke

    Thanks for the suggestion of deleting the JetFileBackup folder, Micromouse. I'll try it.
    Any other files look deletable? Without any way to move them, I may have to try deleting some and see what happens.
    I'm not even sure which Creative programs can be uninstalled (other than Nomad Explorer) and still be able to use MediaSource to play songs from my Zen Xtra (through a USB connection). Windows Add/Remove Programs says that I've used all of these programs today:
    Creative Jukebox Driver
    Creative MediaSource
    Creative MediaSource AudioSync Plugin
    Creative MediaSource NOMAD Jukebox 2/3/Zen Plugin
    Creative NOMAD Jukebox Zen Xtra
    But all I've done is open MediaSource and start a playlist from my Zen Xtra. Anybody know which of those can be uninstalled without affecting my use? (Maybe this deserves a separate topic.)
    Thanks,
    Luke

  • How Can I Search for Media files by Length?

    I want know how can I search for media files (mov, mp4, flv and movie files in general) by their length?
    If this search function is confirmed as definitely not possible on the OS, I would appreciate someone recommending app that might be able to perform such a search?
    Many thanks

    No possible way. Because the files may be enoded with differing codecs, compression, etc., you can only sort by file size, not the 'length' of the movie files.
    Clinton

  • [JS][CS3]how to get refrence for source file

    Hi All
    I am new and learning javascript Gradually Could any one help on this as i do have a code for load style but don't know how to get refrence for "source file" and "targetDoc"
    targetDoc.importStyles(charImport, sourceFile, clashPolicy);
    targetDoc.importStyles(paraImport, sourceFile, clashPolicy);
    Can any one figure it out
    Many Thanks

    I'm not sure what you are trying to achieve, could you please elaborate?
    Do you want to load all the styles from one document into all 100 documents, or do you want all the styles from the 100 documents into 1 document or what is the goal?
    The following will let you choose a folder of files, open each of the files in it and import the styles from source document. It is not a complete script, make sure to test and modify before running on anything else than test files :-)
    var MyFolderWithFiles = Folder.selectDialog ("Choose a folder");
    var sourceFile = File.openDialog("Choose the styles source");
    var myFiles = MyFolderWithFiles.getFiles("*.indd");
    for(i = 0; i < myFiles.length; i++) {
        theFile = myFiles[i];
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
        var targetDoc = app.open(theFile, true);
        app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
        targetDoc.importStyles(ImportFormat.CHARACTER_STYLES_FORMAT, sourceFile, GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);
        targetDoc.importStyles(ImportFormat.PARAGRAPH_STYLES_FORMAT, sourceFile, GlobalClashResolutionStrategy.LOAD_ALL_WITH_OVERWRITE);
        targetDoc.close(SaveOptions.YES);
    Thomas B. Nielsen
    http://www.lund-co.dk

  • How to add support for new file type.

    Using the ESDK, I would like to add support for new file type ( a new extension). this new extension will function like any other non visual code editor but will have specific syntax highlighting, code folding and explorer.
    I am trying ot figure out if I need to create a new editor or use existing JDeveloper code editor and add support for new file type. Does anyone have a high level outline on how to do this using the ESDK that is specifically targeted at adding new file type support for a text based code editor?
    I have looked at the Samples and keep going in multipe directions. It would be cool if there was an example that was how add syntax higlighting for new file type.
    Thank you

    Brian, thank you. I looked at this extension and it answered a lot of questions for me. I was going in the right direction but needed a little help and bost of confidence, this is just what I needed. I created the LanguageSupport, LanguageModel, Addin, Node and TextDocument that are specific to the new file type. I was getting hung up on how to hook this into the JDevelpoer editor. I keep thinking I have to create a custom editor but it looks like I don't have to and it looks like I can associate this file support with the editor framwork, for version 10.1.3.2, with the following in the Addin Initilize() method.
    Recognizer.mapExtensionToClass(MY_EXTENSION, MyNode.class);
    CodeEditor.registerNodeType(MyNode.class, MY_EXTENSION);
    LanguageModule.registerModuleForFileType(new MyLanguageModule(), MY_EXTENSION);
    I have done this but still not able to recognize the new file type.
    At this point, I just want to be able to recognize the new file and display it's associated icon or display a messare to the message log. I put a System.out.println("test") in the Initilize() method of my addin. then I registered MyAddin in the extension.xml. JDeveloper sees this new extension and it is loaded but I have not been able to show the test message or display the new icon when I open the new file type.
    extension.xml
    <?xml version="1.0" encoding="windows-1252" ?>
    <extension xmlns="http://jcp.org/jsr/198/extension-manifest"
               id="teisaacs.jdev.myext.MyAddin" version="1.0.0" esdk-version="1.0"
               rsbundle-class="teisaacs.jdev.myext.resources.MyResBundle">
        <name rskey="EXTENSION_NAME">My Code Editor</name>
        <owner rskey="EXTENSION_OWNER">Me</owner>
        <dependencies>
            <import version="10.1.3">oracle.jdeveloper</import>
        </dependencies>
        <hooks>
            <jdeveloper-hook>
                <addins>
                    <addin>teisaacs.jdev.myext.MyEditorAddin</addin>
                </addins>
            </jdeveloper-hook>
            <feature-hook>
                <description>My Code Editor</description>
                <optional>true</optional>
            </feature-hook>
            <document-hook>
                <documents>
                    <by-suffix document-class="teisaacs.jdev.myext.model.MySourceDocument">
                        <suffix>my</suffix>
                        <suffix>MY</suffix>
                    </by-suffix>
                </documents>
            </document-hook>
            <editor-hook>
                <editors>
                    <editor editor-class="teisaacs.jdev.myext.editor.MyEditor">
                        <name rskey="EXTENSION_NAME">My Editor</name>
                    </editor>
                    <mappings>
                        <mapping document-class='teisaacs.jdev.myext.model.MySourceDocument">         
                            <open-with editor-class="teisaacs.jdev.myrext.editor.MyEditor"
                                       preferred="true"/>
                            <open-with editor-class="javax.ide.editor.CodeEditor"/>
                        </mapping>
                    </mappings>
                </editors>
            </editor-hook>
        </hooks>
    </extension>
    public class MyAddin implements Addin {
        public static final String MY_EXTENSION = "my";
        public void initialize() {
            System.out.println("MyEditor Constructor");
            new MyLanguageModule();
            Recognizer.mapExtensionToClass(MY_EXTENSION, MyNode.class);
            CodeEditor.registerNodeType(MyNode.class, MY_EXTENSION);
            LanguageModule.registerModuleForFileType(new MyLanguageModule(), MY_EXTENSION);
    }I have added and removed the editor hook along with many other modificaitons to the extension.xml but still not recognizing the new file extension.
    Todd

  • How do I search for a file across all my macs on my network

    I have three macs. Two operate wirelessly, one does not, but they are all part of the same network.
    Does anyone know how to search all macs simultaneously for a particular file? I have leopard installed on all macs.
    Thanks
    Buck

    Apparently, the "Shared" search location button only shows up if you first connect to some 'sharepoint' from the Sidebar "SHARED" list and the sharepoint 'volume' then appears in the Sidebar "DEVICES" list. For me, not all 'volumes' do this -- just those that are really some sub-directory of a remote Mac do, but not (for instance) those that are that Mac's complete, top level startup volume.
    BTW, even when the button does show up, the searches are very slow & usually don't find items on the remote Mac that I expect they should.
    I think it is a bug, or more accurately an incompletely implemented feature.

  • PSE 7: "Base directory" for locating files?

    I'm trying to salvage a Photoshop Elements 7 catalog that won't cleanly regenerate thumbtails on the old machine (so it hangs). I tried deleting the cache, but the system crashes the first couple of times regenerating the thumbnails, and eventually seems to "hang" at 50% CPU (sits for hours, seeming doing nothing).  The log file is no help.
    On my new machine, there is no hang, but PSE 7 it is VERY slow to re-locate files, since everything is now at a different location.
    Question: Is there a way to set the "base directory" for where Elements starts its search for files, when the location referenced in the catalog has changed?  Is there another way to update the catalog, when the physical location of files has changed?
    I wanted to backup from the old machine and restore to the new via an external USB disk, but because the old machine "hangs" on the thumbnails, I can't.  At this point, I'm thinking of re-cataloging my thousands of photos...

    That's not how PSE works.
    PSE knows about photos only if you Import the photos into PSE. Then, PSE knows what folder the photo files are in, and they must remain in that directory, unless you use PSE to move them.
    So, if the photos are in different directories on the new computer, you must reconnect the photos to the PSE Organizer. Here are the details on how to do this: http://www.johnrellis.com/psedbtool/photoshopelements-6-7-faq.htm#_Quickly_reconnecting_la rge

  • Looking in the wrong directory for class file

    My javabean looks like this:
    <jsp:useBean id="mailer" class="MailerBean">
    <jsp:setProperty name="mailer" property="*"/>
    <% mailer.sendMail(); %>
    </jsp:useBean>
    The actual MailerBean.class file is in ROOT/public_html/servlets directory. The file that uses the above javabean is in ROOT/public_html/clearresults directory. I have tried a bunch of different lines of code to point to the servlets directory with no success. The javabean continues to point to the ROOT/public_html/clearresults/MailerBean.class file when it should point to ROOT/public_html/servelts/MailerBean.class. How can I point the MailerBean class to the servlets directory without moving the file that uses the javabean?

    Generally you don't have to write code to say where a class is, and I don't know what "pointing" a class is. Things that run servlets and JSPs have rules about where they will look for classes. All you have to do is put your MailerBean class where the rules say to put it. Often that's a directory called something like .../WEB-INF/classes, but check out the rules for your product.

  • How to create link for pdf file in discoverer worksheet

    Hi All,
    I would like to create a link for pdf file into discoverer report (worksheet).
    So that i can open linked pdf file using worksheet link.
    Can any one tell me about this?
    Thanks
    Ravi

    Hi,
    I think the best way to do this is to use a database directory so that you can access your pdf file as a bfile. Then create a mod_plsql procedure that sets the mime type and downloads the pdf file. You then create a calculation in the EUL then returns the URL to your mod_plsql procedure. You can then include this calculation as a hyperlink in your worksheet.
    It is not as difficult as it sounds. Please let me know if you need anymore details.
    Rod West

Maybe you are looking for

  • TS: Pre-installed Windows 8.1 attempt to install windows 7.

    Greeting, I recently get a Dell laptop with pre-installed Windows 8.1, but I find out there are many compatibility issues on Windows 8.1. So I decided to install Windows 7 ultimate 64 bit into the system without wipe out the windows 8.1. I followed a

  • How can I open McAfee encrypted (EEFF) PDF files with Adobe Reader?

    How can I open McAfee encrypted (EEFF) PDF files with Adobe Reader?  Get error "There was an error opening this document. Access denied".  Disabling Protected Mode in Reader doesn't always work. McAfee: https://kc.mcafee.com/corporate/index?page=cont

  • Everytime I run mac-mini on my TV I have to change the mouse speed and the wallpaper

    Could I save the configuration in order not to do this operation everytime I turn on the mac-mini? Thank you!

  • Problem with indexing a PDF file

    Hi all, We can most of the time successfully index PDF files, but sometimes it simply fails to do so. Nothing wrong with the code, but it looks to me that some PDF files are not accepted. Is there some sort of a list from Oracle which tells me what v

  • Sharepoint 2013 master/detail

    In a sharepoint 2013 web part, I am planning to have a master/detail association. The master will contain data that does not change where the detail will be data that is entered on a weekly basis. My questions include the following: 1. My fist questi