Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5720

Unify filename checks to use FileUtil.findFreeFileName or .isValidFileName

    XMLWordPrintableJSON

Details

    Description

      Multple definitions of invalid filenames are scattered throughout the codebase. Should be unified. Sample list (perhaps not exhaustive):

      enterprise/web.jsf/src/org/netbeans/modules/web/jsf/wizards/CompositeComponentWizardPanel.java:        if ("".equals(filename) || INVALID_FILENAME_CHARACTERS.matcher(filename).find()) {
      enterprise/weblogic.common/src/org/netbeans/modules/weblogic/common/api/DomainConfiguration.java:    private static final  Pattern FILE_NAME_PATTERN =
      enterprise/glassfish.javaee/src/org/netbeans/modules/glassfish/javaee/db/VendorNameMgr.java:    private final static char []    ILLEGAL_FILENAME_CHARS     = {'/', '\\', ':', '*', '?', '"', '<', '>', '|', ',', '=', ';' };
      enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceConfigurator.java:    private final static char[]   ILLEGAL_FILENAME_CHARS     = {'/', '\\', ':', '*', '?', '"', '<', '>', '|', ',', '=', ';' };
      enterprise/j2ee.sun.appsrv/src/org/netbeans/modules/j2ee/sun/api/restricted/ResourceUtils.java:    private final static char[]  ILLEGAL_FILENAME_CHARS     = {'/', '\\', ':', '*', '?', '"', '<', '>', '|', ',' };
      ide/target.iterator/src/org/netbeans/modules/target/iterator/api/TargetChooserPanel.java:    private static final Pattern INVALID_FILENAME_CHARACTERS = 
      java/maven/src/org/netbeans/modules/maven/actions/CreateLibraryPanel.java://                        StringValidators.REQUIRE_VALID_FILENAME,
      javafx/javafx2.project/src/org/netbeans/modules/javafx2/project/fxml/FXMLTemplateWizardIterator.java:    static final char[] NO_FILENAME_CHARS = { '/', '<', '>', '\\', '|', '\"', '\n', '\r', '\t', '\0', '\f', '`', '?', '*', ':' }; //NOI18N
      webcommon/web.clientproject.api/src/org/netbeans/modules/web/clientproject/api/util/ValidationUtilities.java:    private static final char[] INVALID_FILENAME_CHARS = new char[] {'/', '\\', '|', ':', '*', '?', '"', '<', '>'}; // NOI18N
      
      
      

      Attachments

        Activity

          People

            sdedic Svatopluk Dedic
            sdedic Svatopluk Dedic
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: