Current Position:Home > Folder containing Swedish characters isn't recognise. IsDirectory()

Folder containing Swedish characters isn't recognise. IsDirectory()

Update:12-10Source: network consolidation
Advertisement
Hello!
I have a problem with an application that is supposed to delete folders containing to files.
It works fine but a folders name contain Swedish charters the applications doesn't work
because that folder doesn't get recognizes as a directory by isDirectory().
public static boolean deleteDir(File dir) {
        if (dir.isDirectory())
            String[] children = dir.list();
            for (int i=0; i<children.length; i++)
                boolean success = deleteDir(new File(dir, children));
if (!success)
return false;
// The directory is now empty so delete it
return dir.delete();
Is there a way to get this work?
Help.
Best regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

The Best Answer

Advertisement
Bor0 wrote:
Hello!
I have a problem with an application that is supposed to delete folders containing to files.
It works fine but a folders name contain Swedish charters the applications doesn't work
because that folder doesn't get recognizes as a directory by isDirectory().Are you sure that that is the problem?
I created a folder named "Detta är ett katalognamn" and executed this code:
public class DirectoryTest {
    public static void main(String[] args) {
        String directoryName = "Detta är ett katalognamn";
        System.out.println("isDirectory: " + new File(directoryName).isDirectory());
}It prints:
isDirectory: true
Kaj
  • Folder containing Swedish characters isn't recognise. IsDirectory() Update:12-10

    Hello! I have a problem with an application that is supposed to delete folders containing to files. It works fine but a folders name contain Swedish charters the applications doesn't work because that folder doesn't get recognizes as a directory by i

  • LR 2.1 Unable to Open as Smart Object in PS CS3 due to swedish characters in folder name Update:10-11

    When I try to open a raw file from Lightroom 2.1 as a smart object in Photoshop CS3 and the folder contains swedish characters, like åäöÅÄÖ, it will not open at all -> PH starts up and presents a "Open As" dialog. It works fine when I open im

  • Special/Swedish characters in an AXL request Update:10-11

    Hello, I am developing an application that is adding a user to the Call Manager (4.1). When I try to add a name with swedish characters (???) the CCM changes them to question marks "?". I have tried adding the swedish characters unicode encoded,

  • Issue with Swedish Characters in mail body Update:10-11

    Hi, We are sending mails to some other system from SharePoint. All the swedish characters like ä,Ä,ö become ???. When we are sending mails from outlook to that system , we are getting proper mail. so the issue is from sharepoint side. we are sending

  • Swedish characters in OEM reports Update:10-11

    Hi, I have created a report that lists a table that have text with swedish characters in it. When i publish the report as "Whenever the report web page is viewed" the charachters is shown correctly, but with the option "Only when scheduled&

  • Problems displaying swedish characters ! Update:10-11

              Hi !           I have a very strange problem, which I have been struggling with for a while now.           I have a JSP page which calls Java classes to generate a HTML table. I define the           basic structure of the table in the JSP f

Recommended Content

  • I can not get my iPad to mirror with Apple TV. When I toggle to mirror the tv screen goes black and the iPad freezes. The iPad iso is up to date
  • Check number not getting updated in vendor line items
  • TS4124 I have around 1000 songs manually downloaded from my CD's to iTunes in my iPhone before an operating system change on my computer deleted my iTunes and had to create a new one.  The music won't transfer to my new iTunes!  How do I get it back?
  • I have an Apple ID, and shared purchases with my 3 kids devices. Now they want to have their "own accounts" so when they get iTunes gift cards, they can pay for their own things. Can we share these purchases? My household is as follows:
  • Can i back up to iphones on the same lap top with the same apple id? or do they each need their own apple id?  Will it cause the data to mix or cause one to lose its data?
  • Signed up for a Triple Play Bundle. Reps can't fix billing because they no longer offer that bundle.
  • HP LaserJet P1102w - Flashing Wireless Light
  • In Windows 7 64-bit Bootcamp 5 my USB connected mouse intermittently clicks the left-button without my input. How do I fix?
  • If I use an SD card for both Windows 7 and Mac, is there any way to see the documents from the Mac sight while on the windows side?
  • Time Machine backup from clean reinstall of mountain lion
  • Migrating for outlook to t-bird, trying to import mail, error "either there is no default mail client...", I have confirmed that outlook is default, ?
  • Lost all my bookmarks when i had to erase my mac and re-install operating system.
  • Resizing Boot Camp Partition
  • Unable to copy/cut/paste from within custom file naming dialogue (in exporting images)
  • Text fields are not displayed for custom infotypes in Adhoc query