How to deal with query that works like dir or ls

I just can't figure it out how to deal with query that works like dir (Win32) or ls(unix) with special character like '*' and '?' , ex. c:\> dir j*.t?t
Could somebody please tell me?

Here's some code for using a FileFilter for the listFiles() method of the File class:
import java.io.*;
    FileFilter myFileFilter = new MyFileFilter("*.t?t");
    File[] files = File.listFiles(myFileFilter);
  class MyFileFilter implements FileFilter {
        private String pattern;
        public MyFileFilter(String pattern) {
            this.pattern = pattern;
        public boolean accept(File file) {
            if (file.isDirectory()) {
                return false;
            if (file.getName() ??matches?? pattern) {
                // you'll have to put the pattern match code here!!
                return true;
            return false;
  }maybe someone else can help with the pattern matching!

Similar Messages

  • How can I make an app with xcode that works like a news app? So that I can post articles on the app. Do I have to use a database or can I connect the app directly with my mac?

    How can I make an iphone app with xcode that worrks like a newspaper? So that I can post articles on the app while it is on appstore. Can I directly connect the app with my mac or do I have to connect it to a database?  Thanks

    Funny, I was thinking you'd want to use the prescribed deployment that Apple went to all the trouble to provide so you wouldn't trot down the garden path with some other implementation, only to find your app rejected with the admonition to use Newsstand after all...
    If you're all hot to ignore all that & DIY, why are you even asking...why not just go for it...

  • How to deal with CSSs that conflict/clash with CQ's CSSs?

    Hi there,
    I am working on building a website in CQ that uses free styles from www.99lime.com.  This is a requirement of the client, not my personal choice.
    The problem is that the kickstart styles are conflicting/clashing with CQ, such that when I open a page in the Content Finder, the Sidekick - Components tab is empty; if I go into Design mode to ensure components are selected, the Component lists don't display; I see the component groups (general, etc) but then a bunch of lines.  When I comment out the kickstart.css, the Sidekick displays correctly so that's how I know the kickstart styles are the issue.
    How do I resolve these conflicts without having to rename every element in the kickstart css's?
    Thanks in advance.
    New CQ User.

    You can uses CSS selectory specificity to help. Add a class to the wrapping div or body for your apps pages ex .kickstarter. Then just prefix each selector with the .kickstarter class.
    Using LESS you can just wrap the whole of the file in a single nested rule like so:
    .kickstarter {
        HTML ELEMENTS
        a{color:#4D99E0;outline:0;}
        a:active{color:inherit;}
        a:visited{}
        a:hover{}
        a img{border:0;}
        strong,b{color:#000;background:lightyellow;position:relative;top:0;left:0;padding:2px 5px;}
        strike{}
        em,i{}
        .hide{display:none;}
        .show{display:block;}

  • Browser compatable with OSX that works like IE????

    My school only works with IE. No other browsers supported. I've tried Safari, Firefox, Camino, and Opera. I finally installed Parallels and I'm using XP home, just for IE. Is there any way to get IE running on the Mac OS?

    Have you already tried changing your user agent to MSIE by way of the Debug menu? If all else fails, there's always the now-discontinued MSIE 5.2.3 (link). Note, however, that before it was discontinued, it hadn't been updated for at least 2 years. Use it at your own peril.
    Yang

  • My iphone 5 open-close key does not work,how to deal with?, my iphone 5 open-close key does not work,how to deal with?, my iphone 5 open-close key does not work,how to deal with?

    I bought the iphone5 on your online store on Nov24. 2013, Last year, I came back China. more ten days before, my iphone 5 's open-close-key did not work. I contact Apple's China, but they told me that they could not help me repair the problem, how to deal with ?

    What is the "open-close" key?  Do you mean the power button or the home button?
    FYI, these are user to user support forums, you are not addressing Apple here.
    Warranty and support are ONLY valid in the country of origin.

  • How to deal with moving around like in gta2?

    Hi there,
    I'm programming an game but i was wondering how to deal with moving around like in gta2.
    my game is also top-down with you(tha player) constantly in the middle of the screen. I know how to deal with button press etc.. but how to calculate how manny pixels the map has to move in the x and y axis...
    It's difficult to explain for me.. but hope the picture is clear..
    greetings

    I was afraid for this one already.. the picture is not clear:) thanx for your response so far.. I will try again.. with the game gta2 in mind:)
    see this screenie: http://www.vollversion.de/bilder/705_1_full.jpg
    My game looks the same as gta2 top down... with the character in the middle of the screen(the one firing the flame thwower )(the player). if i press up he walks towards the police car.. if i press left or right.. he only turns around(an combination of pressing up and left is also posible) thus the character walks in the direction he's facing.
    Now i would like to know how did they do this? how to programm such a movement? Because the character is standing constnatly in the middle of the screen the map has to move like in almost every game... how to calculate the x and y axis movement of the map?
    Please.. try agian.. hopefully the screenie will help.

  • When opening aperture I get Warning that says There was an error opening the database for the library "~/Desktop/Feb 12, 2011.aplibrary".  I'm concerned that my pictures may be lost.  Does anyone know how to deal with this Warning?

    When opening Aperture I get Warning that says "There was an error opening the database for the library “~/Desktop/Feb 12, 2011.aplibrary.”  That's it. The program does not open at all.  I'm concerned that my pictures may be lost.  Does anyone know how to deal with this Warning? 

    Might just need to rebuild the library...see this link:
    Aperture 3: Troubleshooting Basics

  • When I attempt to connect my new MacBook Air to my home network I receive a dialogue that says " Could not join name of network .  A connection timeout has occurred.  Any ideas on how to deal with this?

    When I attempt to connect my new MacBook Air to my home network I receive a dialogue that says " Could not join <name of network>.  A connection timeout has occurred.  Any ideas on how to deal with this?

    Please review the following Apple Support article for assistance with troubleshooting wireless connections.
    You may also find this OSXDaily article helpful as well.

  • How to deal with the rule that do not use "object" class to declear a class

    I run my flex project in sonar. And there is a rule "Do not use Object class ".
    I just want to know how to deal with this problem.
    I mean, when I try to write a base class, I don't know which kind of class will be transfered in by reference, which type I can declear instead of "object"?

    Check out this example:
    The moment I put in the code >> box1.addItem("hello"); << and run the application, the BusNameListener is fired. Hope this makes sense.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class JFrameExample {
    private JComboBox box1;
    public JFrameExample() {
    box1 = new JComboBox();
    box1 .setMinimumSize(new Dimension(300, 24));
    box1 .setPreferredSize(new Dimension(300, 24));
    box1.addActionListener(new BusNameListener());
    box1.addItem("hello");
    JFrame f = new JFrame("This is a test");
    f.setSize(400, 150);
    Container content = f.getContentPane();
    // content.setBackground(Color.white);
    content.setLayout(new FlowLayout());
    content.add(box1);
    f.setVisible(true);
    class BusNameListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    JComboBox cb = (JComboBox) e.getSource();
    String item = (String) cb.getSelectedItem();
    if (item != null) {
    JOptionPane.showInputDialog(null,
    "Specify...", "File Import",
    JOptionPane.OK_CANCEL_OPTION);
    }

  • How to deal with "Error 1001. The specified service already exists" when install a service using installer package?

    Hi everybody,
    I wrote a "Class Library" project which is a service using Visual Stodio 2008 recently, then tried to use a Visual Studio 2008
    Setup Project to install it.
    Here is what I did for the "Class Library":
    1. Finish the program.cs, Service.cs
    2. Add Installer
    3. Change the serviceInstaller so that "StartType" to be Aotumatic
    4. Change the ServiceProcessInstaller2 so that "Account" to be LocalSystem
    5.
    6. Click in F5 (Start Debugging)
    Here is what I did for the Setup Project:
    1. Add the exe file built from the "Class Library" project to the Application Folder
    2. On the Custom Action Editor, add the exe file from 1 to Install and Commit
    3. Change the property of the project so that "RemovePreviousVersion" to be true
    4. Click on F6(Build Solution)
    Then I tried to run the msi file from the built of the Setup Project. Because I modified the two projects serveral times, I uninstalled the Class Library using "Control Panel->Add or Remove Programs" before I reinstall. Two things I notived:
    1. After unstall, the registry was not cleaned up about the installed program
    2. After several rounds install/uninstall, I got "Error 1001. The specified service already exists"
    My questions are:
    1. How to cleanup the registry when uninstall a program?
    2. How to deal with the "Error 1001. The specified service already exists"?
    3. Did I do anytbing wrong with the "Class Library" or the "Setup Project"?
    Thanks a lot!
    Helen

    Hi Simon, not a problem!
    I spent some more time on this and here are few more notes:
    it is called Major Upgrade, when you are installing new version of the product upon a previous one and
    MSI supports 2 strategies:
    Strategy 1. Install a new version and uninstall previous one. (Install a new version right upon previously installed version (file merging is performed based on dll version number) and the delete previously
    installed files)
    Strategy 2. Uninstall previous version and install a new one (Delete all previous files and install from scratch new files.)
    From the first look it seems that 1st strategy is weird and buggy. But, remember, MSI is great because it's transactional!!! That means that if once some of the phases (Installation, Uninstallation, Rollback, Comit) fails, your machine
    will be reverted to the previous state and it'll be still functional. 
    Let's consider both strategies:
    Consider you have installed product_v1.msi and you want to install product_v2.msi.
    Strategy 1
    1. MSI engine copies files from Product_v1 directory to TEMP directory
    2. MSI engine merges files based on the assembly version (between v1 and v2)
    3. Once merging is completed successfully it removes files in TEMP (RemoveExistingProducts  action triggers it) and you got product_v2 installed, otherwise if it fails MSI engine revert machine to V1 and copies previous files from TEMP.
    Strategy 2
    1. MSI engine tottaly removes all files from v1.
    2. MSI engine installs v2 files and if something goes wrong you cannot revert back, because RemoveExistingProducts  allready worked out and MSI doesn't have files to revert machine back
    I recommend to everybody to use Strategy 1 and leverage MSI transaction functionality. And you can set this strategies by defining sequence of RemoveExistingProducts action. See more info
    here.  So, I think it's not even a bug in VS as I said in the upper post it is default recommened behaviour.
    AND, you got "Error 1001. The specified service already exists"
    because if we follow Strategy 1 MSI engine tries to install Windows Service on top of the existing service and OF COURSE it fails MSI engine (StopServices, DeleteServices actions are executed before actual
    installation and  they look at ServiceControl table). In order to stop service first and delete them you have to fill ServiceContol table of the MSI (and then StopServices, DeleteServices actions will recognize what to they have to stop
    and delete), like this:
    *clip*clip*clip*
    ' see http://msdn.microsoft.com/en-us/library/windows/desktop/aa371634(v=vs.85).aspx for more info
    ' Update the Service Entry to stop and delete service while uninstalling
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD_Service', 'Service name', '160', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    ' Update the Service Entry to stop and delete service while installing
    query = "INSERT INTO ServiceControl (ServiceControl, Name, Event, Arguments, Wait, Component_) VALUES ('MAD2_Service', 'Service name', '10', '', '1', '"
    + componentName + "')"
    Set view = database.OpenView(query)
    : CheckError
    view.Execute : CheckError
    *clip*clip*clip*
    We can uninstall service first by following Strategy 2, but then we lose transactional support.
    So, Simon did I encourage you to change your code a bit?:)
    And, btw, if you don't want to change the strategy, please don't rely on SequenceID in MSI table, it can be change, you have to get the at the runtime.
    Hope it will help to everybody!
    See also more advanced explanation of how MSI works
    here.
    Truly yours, Marat

  • How to deal with credentials for external applications using a Java Client/

    Hi Guys,
    This is the case. I am integrating an external application with an ADF Application. I have implemented some programmatic ViewObjects that are being filled up by a REST Java Client Wrapper. Everything is working fine but the issue is that the credentials the wrapper is using are hard coded inside the java class. I am thinking to ask for the credentials at the beginning of my taskflow and then store them somewhere and use them then to create my client wrapper (passing them in the constructor).
    However, I don't know if my approach is good and I would like you to share your experiences or how to deal with this.
    Regards

    You can use Credential Store Framework to store the credentials securely in the weblogic server instead of hardcoding in the java class.
    The Credential Store Framework:
    - enables you to manage credentials securely
    - provides an API for storage, retrieval, and maintenance of credentials in different back-end repositories
    Check the documentation on CSF API -
    http://docs.oracle.com/cd/E29505_01/core.1111/e10043/devcsf.htm
    Major Steps -
    1. Create a credential map and key in em console to store the password (http://docs.oracle.com/cd/E25054_01/core.1111/e10043/csfadmin.htm)
    2. Use CSF API to retrieve the stored password
    3. In jazn-data.xml give permissions to access CSF key and map

  • How to deal with file(for example .xml)? what format of dir should be?

    I'd like to operate the file in disk, and want to use relative directory?
    How to deal with file dir? what format of dir should be?

    Hi Kamlesh,
    Thanks for your response.
    Actually, In the "Process External Bank Statement" window, i see that there are few entries which is for the previous year and which has not been reconciled. I have never worked practically on BRS and hence, i am scared to make any changes in the clients database without being confident on what i am doing. I need to reconcile for one of their Bank a/c for the month of April '08. I have the copy of the statements for the month ending 31st Mar 08 and 30th Apr 08. The closing balances are as below:
    31/03/08 - 2300000.00
    30/04/08 - 3100000.00
    Now my OB for Bank a/c for April '08 in SAP is 2300000.00 Dr.
    When i go to External Bank Reconciliation - Selection Criteria Screen (Manual Reconciliation), here are the detail that i enter:
    Last Balance: INR -7,000,000.00000 (Grayed out by the system)
    Ending Balance: INR -3,100,000.00000 (Entered by me)
    End Date: 30/04/08 (Entered by me)
    "Reconciliation Bank Statement" Screen opens up and shows the below balances in the screen:
    Cleared Book Balance: INR -7,000,000.00000
    Statement Ending Balance: INR -3,100,000.00000
    Difference: INR 3,800,000.00000
    As per the Bank statement, i have found all the transactions listed out here for the month of Apr '08 but, i also found that the open transactions for the previous month from April '08 have been lying in "Process External Bank Statement" window.
    Could you please help me solve my issue as to what needs to be done or could you also get me some links from where i can get few documents for processing External Bank Reconciliations?
    That will be of a great help for me. I need steps as to what needs to be done first and then the next so that i can arrive at the correct closing balance for the month April '08.
    Thanks in Advance....
    Regards,
    Kaushal

  • How to deal with 0...n or 1...n mappings?

    Hi all,
    I'm relatively new to BPM. I've already made several processes that are working fine. However, I'm now stuck because, for the life of me, I'm not able to understand how to deal with data mappings of nodes of a cardinality greater than 1...1.
    I'm used to dealing with 0...n inputs of Web Services in Webdynpro Java and CAF Application services, using java code... but I just don't get how to deal with these in a BPM data mapping scenario.
    Let's say you have a Web Service whose input is a node called "Employee", where you can add n Employee objects, like this:
       Employee (0...n)
          FirstName: String
          LastName: String
    How do you:
    1- map a 0...n context node from a Web Dynpro or Web Service output, already containing several employees, into this Employee 0...n WS input node?
    2- map a 0...n context node from a Web Dynpro or Web Service output, containing NO employees, into this Employee 0...n WS input node, without getting an error and the BPM crashing because it says the employee element is not found?
    Hopefully someone can help me with this, because I'm about to go the way of calling the web service n times, one employee at a time, instead of one time with a Employee object with n registries in it.
    Thanks!

    Hi Abhijeet,
    i think i should have mentioned this earlier. My Employee node is inside another node.  So, the actual input structure of the WS is this:
    InputValues (1...1)
       Employees (0..n)
          FirstName: String
          LastName: String
    This scenario works OK in BPM when mapping a 0..n node using deep copy as Jocelyn explained, but I still doesn't work if I want to pass an empty (not null) Employees array.
    If I go to the WS Navigator and run this WS with the following parameters, it runs ok (I get an output message saying no employee was selected, which is how it should work):
    InputValues -  "Is null" checkbox not activated.
       Employees - "Skip" checkbox not activated
          FirstName - "Skip" checkbox activated
          LastName - "Skip" checkbox activated
    However, if instead of activating the checkbox of, say, "FirstName", I enter a "" value, I get an error from the WS saying that's not a vaild first name, which is also how it should work.
    In java code, I would just pass an empty InputValues object to the WS, but I'm not sure how to do this in a BPM without it being considered null, and without having to set on of its String-child values to "".
    Do you know how to achieve this?

  • How to deal with generated programs in eCATT SAPGUI recording?

    Hi experts and professionals,
    I am trying to automate testing of our solutions by eCATTs and so far i have not been able to find solution for following problem.
    Whole test scenario is very simple:
    Check InfoProvider data (query, lookup, listcube,...)
    Create DAP on InfoProvider
    Archive InfoProvider
    Check InfoProvider data (query, lookup, listcube,...)  again
    Compare results from step 1. and 4. (must match)
    Reload archived data
    Check InfoProvider data (query, lookup, listcube,...)  again
    Compare results from step 1. and 7. (must match)
    As you can see, one of the required test steps is to check InfoProvider's data in transaction LISTCUBE.
    But transaction LISTCUBE generates its program "name" every time it is executed and
    I am struggling to find a way how to deal with these generated programs in eCATT SAPGUI recording.
    Key is that solution must be generic and work for all SAP BW releases from 7.0 upwards
    (having in mind that LISTCUBE can read NLS data from SAP BW 7.3 release).
    Error description from eCATT log:
    Screen Check Error: Expected Transaction: LISTCUBE, Actual Transaction: LISTCUBE.
    Expected Program: GP0KOZE7EFIUBN10MZUFWX90W80, Actual Program: GPBP24INA6VV77SL0XKU5NA642O.
    Expected Screen Number: 1000, Actual Screen Number: 1000.
    There Is Probably an Error in SAPGUI recording.
    ExceptionClass:CX_ECATT_APL_CAPTURE  ExceptionId:SCREEN_CHECK_ERROR
    RaisingClass:CL_APL_ECATT_LINE_INTERPRETER  Include:CL_APL_ECATT_LINE_INTERPRETER=CM00J  Line:443
    Is there any way how to avoid program check in eCATT script?
    Anything that would help me to find solution will be greatly appreciated.
    Best Regards,
    Igor

    Dear Igor,
    Your issue is caused by the "screen check" which eCATT processes here.
    In General this screen check is a very usefull activity, since is ensures that only those screens are processed by automation, which initially where recorded. This should ensure as much as possible to invoke only intended activities.
    Remember, that the driver of the screen flow is still the automated transaction program ( but not the test tool). So application logic decides which screen is send next.
    Using screen check the test tool tries to ensure that menu items and buttons and other activities are only automated when the tool "believes" to work on the intended screen.
    For generic test scripts and often in context of generated programs the screen check might hurt a bit.
    To overcome this, one might try to make the check dynamic (as Sheetal suggests correctly).
    If here the name of program cannot be determined for any reason, one can use another method and do following:
    - Change the value of ProcessedScreen-Active to 'R'
    This will disable/skip the screen-check for this ProcessedScreen.
    Sure the solution includes a certain risk, since not checking the correct screen to appear might lead to automation of actions with not desired impact.
    Maybe this can improve your solution.
    Kind Regards
    Jens

  • How to deal with dynamic IP address changes

    I have installed Fodero C3 and Oracle 10g successfully. Oracle 10g use web OEM console to manage database. However, my internet provider only provided me a dynamic IP address. When I installed Fedora C3, Linux server automatically picked a Hostname like " ip12-345-678-90.dc.dc.cox.net". After I created database, all database files also used this hostname. Then Oracle web OEM console worked fine. Due to the dynamic IP address assigned by ISP, their DHCP server changed the first part of IP address(ip12-345-678-90)frequently to another one. After IP address changed, I couldn't start up web OEM console and listener because they couldn't find correct hostname (IP address). I have talked to my ISP. It seems that it can not be solved. Anyone knows how to deal with this problem through 10g and OEM console themseleves. I also think about to configure Linux server to solve the problem. I really need your help. Thanks in advance

    Thank all of you so much to respond my questions. I think I have solved the problem. Since the key point was that Oracle 10g OEM console could not work with the frequent changes of IP address made by my ISP. I just bought a 54G wireless router. Then connecting router to cable modem. The cable modem still gets the dynamic IP from ISP, but the router automatically assigned a static IP address to my Linux system with the range from 192.168.0.0 - 192.168.255.255. This IP was control by my router. It is nothing to do with ISP. So I re-created Oracle database with this new static IP. Then OEM console and listener can startup and connect to database without problem. I do think other guru's methods also will work. I just have no time to try them one by one. Thanks again. Your inputs make me learn many things.

Maybe you are looking for

  • Table K9RAAANNNNNNN is not active in the system Message no. K/066

    Good Morning SAP Guru's- I am having an issue during our SAP Upgrade from SP12 to SP18 for my client.  While testing creating a billing document via t-code VF01, we received the above issue which resulted in a Syntax error.  It appears we are missing

  • CJI3 Report - Balance in Controlling Area currency after settlement

    Hi Friends, When I run CJI3 report for one of my projects, the system displays the actual costs in Controlling Area Currency and Object Currency. Controlling Area currency is USD and Object Currency is EUR. After settlement, for one of the cost eleme

  • Unable to publish the block in Rich client (BIWS)

    Hi All, I have created one crosstab block and trying publish this block using with BI services, But getting error message like "unknow" I am not able to create web services Please suggest me, Thanks.

  • Help! with jeep / mopar integration kit

    Okay, so i got my jeep dealer to install the mopar ipod integration kit, and it works with my 30g video, sort of--it plays, and displays the names of the songs on the factory RBQ radio, but when i try to display the playlists, albums, or artists, the

  • I pod not showing in windos or itunes

    yesterday i got a message saying usb powersurge and it said click reset or i wil not be able to use that port a gain so i did and it said it again so i did. so about an hour later i tryed it again and nothing came up. then i check itunes to see if it