src/share/jaxws_classes/com/sun/tools/internal/ws/processor/util/DirectoryUtil.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 94,109 **** String filePath = file.getCanonicalPath(); return filePath.substring(basePath.length()); } ! private static void ensureDirectory(File dir) ! throws GeneratorException { ! ! if (!dir.exists()) { ! dir.mkdirs(); if (!dir.exists()) { throw new GeneratorException("generator.cannot.create.dir", dir.getAbsolutePath()); } } } --- 94,107 ---- String filePath = file.getCanonicalPath(); return filePath.substring(basePath.length()); } ! private static void ensureDirectory(File dir) throws GeneratorException { if (!dir.exists()) { + boolean created = dir.mkdirs(); + if (!created || !dir.exists()) { throw new GeneratorException("generator.cannot.create.dir", dir.getAbsolutePath()); } } }