diff --git a/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/Messages.java b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/Messages.java new file mode 100644 index 0000000000..794872ce56 --- /dev/null +++ b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/Messages.java @@ -0,0 +1,33 @@ +/* + * JBoss, Home of Professional Open Source. + * + * See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. + * + * See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. + */ +package org.teiid.designer.datatools.ui.flatfile; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * @since 8.0 + */ +public class Messages { + private static final String BUNDLE_NAME = "org.teiid.designer.datatools.ui.flatfile.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle + .getBundle(BUNDLE_NAME); + + private Messages() { + } + + public static String getString(String key) { + // TODO Auto-generated method stub + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } +} diff --git a/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/ReplacementFolderSelectionPageHelper.java b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/ReplacementFolderSelectionPageHelper.java index 4f8730e6ab..cf6518eea6 100644 --- a/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/ReplacementFolderSelectionPageHelper.java +++ b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/ReplacementFolderSelectionPageHelper.java @@ -968,6 +968,11 @@ private void validatePageStatus( ) IMessageProvider.ERROR ); status = -1; } + else if ( getFolderLocationString().trim().indexOf(' ')>=0 ) + { + setMessage( org.teiid.designer.datatools.ui.flatfile.Messages.getString( "ReplacementFolderSelectionPageHelper.invalidFolderPathNoSpacesAllowed" ), IMessageProvider.ERROR ); //$NON-NLS-1$? + status = -1; + } else if ( verifyFileLocation( ) == ERROR_INVALID_PATH ) { setMessage( Messages.getString( "error.invalidFlatFilePath" ), IMessageProvider.ERROR ); //$NON-NLS-1$? @@ -981,6 +986,11 @@ else if ( fileURIChoice.getSelection( ) ) setMessage( Messages.getString( "error.emptyFileURIPath" ), IMessageProvider.ERROR ); //$NON-NLS-1$ status = -1; } + else if ( getFileURIString().trim().indexOf(' ')>=0 ) + { + setMessage( org.teiid.designer.datatools.ui.flatfile.Messages.getString( "ReplacementFolderSelectionPageHelper.invalidFileURINoSpacesAllowed" ), IMessageProvider.ERROR ); //$NON-NLS-1$? + status = -1; + } else if ( needsCheckURITest ) { setMessage( Messages.getString( "Connection.warning.untested" ), IMessageProvider.WARNING ); //$NON-NLS-1$ diff --git a/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/messages.properties b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/messages.properties new file mode 100644 index 0000000000..e26ffa9fbb --- /dev/null +++ b/plugins/org.teiid.datatools.connectivity.ui.flatfile/src/org/teiid/designer/datatools/ui/flatfile/messages.properties @@ -0,0 +1,2 @@ +ReplacementFolderSelectionPageHelper.invalidFolderPathNoSpacesAllowed =The folder path cannot contain spaces. +ReplacementFolderSelectionPageHelper.invalidFileURINoSpacesAllowed =The file uri cannont contain spaces. \ No newline at end of file