Revision 981 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.lib/org.gvsig.scripting.lib.impl/src/main/java/org/gvsig/scripting/impl/DefaultScriptingFolder.java

View differences:

DefaultScriptingFolder.java
111 111
        }
112 112

  
113 113
        String id = FilenameUtils.getBaseName(afile.getAbsolutePath());
114
        if( StringUtils.isBlank(id) ) {
115
            id = afile.getName();
116
        }
114 117
        ScriptingFolder parent;
115 118
        if (FilenameUtils.equalsNormalizedOnSystem(this.getFile().getAbsolutePath(), file.getParentFile().getAbsolutePath())) {
116 119
            parent = this;
......
123 126

  
124 127
        } else if (file.isFile()) {
125 128
            if (!file.getName().endsWith(".inf")) {
126
                file = new File(file.getParentFile(),
127
                        FilenameUtils.getBaseName(file.getName()) + ".inf");
129
                file = new File(file.getParentFile(),id + ".inf");
128 130
            }
129 131
            if (!file.exists()) {
130 132
                logger.warn("Can't get Unit, file '" + file.getAbsolutePath() + "' not exists.");

Also available in: Unified diff