Skip to content

Commit

Permalink
Checks for file path spaces in flat file CP
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrillin committed Dec 22, 2015
1 parent 846289a commit 1fa0b11
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
@@ -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 + '!';
}
}
}
Expand Up @@ -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$?
Expand All @@ -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$
Expand Down
@@ -0,0 +1,2 @@
ReplacementFolderSelectionPageHelper.invalidFolderPathNoSpacesAllowed =The folder path cannot contain spaces.
ReplacementFolderSelectionPageHelper.invalidFileURINoSpacesAllowed =The file uri cannont contain spaces.

0 comments on commit 1fa0b11

Please sign in to comment.