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

Unify filename checks to use FileUtil.findFreeFileName or .isValidFileName

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sdedic Svatopluk Dedic
            sdedic Svatopluk Dedic

            Dates

              Created:
              Updated:

              Slack

                Issue deployment