@Override public boolean isValidPath(String path) { return isValidPath(path, (flags & IS_FOR_WINDOWS) != 0); }
@Override public boolean isValidPath(String path) { return isValidPath(path, (flags & IS_FOR_WINDOWS) != 0); }
/** * Returns whether the given string is syntactically correct as a path on a * POSIX file system. The path is correct if each of the segments in its * canonicalized form is valid. * * @param path the path to check * @return <code>true</code> if the given string is a valid path, * and <code>false</code> otherwise * @see #isValidPosixSegment(String) * @since 3.7 */ public static boolean isValidPosixPath(String path) { return isValidPath(path, false); }
/** * Returns whether the given string is syntactically correct as a path on a * POSIX file system. The path is correct if each of the segments in its * canonicalized form is valid. * * @param path the path to check * @return <code>true</code> if the given string is a valid path, * and <code>false</code> otherwise * @see #isValidPosixSegment(String) * @since 3.7 */ public static boolean isValidPosixPath(String path) { return isValidPath(path, false); }
/** * Returns whether the given string is syntactically correct as a path on * the Windows file system. The device id is the prefix up to and including * the device separator (':'); the path proper is everything to the right of * it, or the entire string if there is no device separator. The device id * is not checked for validity; the path proper is correct if each of the * segments in its canonicalized form is valid. * * @param path the path to check * @return <code>true</code> if the given string is a valid path, * and <code>false</code> otherwise * @see #isValidWindowsSegment(String) * @since 3.7 */ public static boolean isValidWindowsPath(String path) { return isValidPath(path, true); }
/** * Returns whether the given string is syntactically correct as a path on * the Windows file system. The device id is the prefix up to and including * the device separator (':'); the path proper is everything to the right of * it, or the entire string if there is no device separator. The device id * is not checked for validity; the path proper is correct if each of the * segments in its canonicalized form is valid. * * @param path the path to check * @return <code>true</code> if the given string is a valid path, * and <code>false</code> otherwise * @see #isValidWindowsSegment(String) * @since 3.7 */ public static boolean isValidWindowsPath(String path) { return isValidPath(path, true); }
/** * Returns a <code>boolean</code> indicating whether the resource name * rep- resents a valid resource name in the workbench. An error message is * stored for future reference if the name does not represent a valid * resource name. * * @return <code>boolean</code> indicating validity of the resource name */ protected boolean validateResourceName() { String resourceName = getResource(); if (resourceName.length() == 0) { problemType = PROBLEM_RESOURCE_EMPTY; problemMessage = NLS.bind( IDEWorkbenchMessages.ResourceGroup_emptyName, resourceType); return false; } if (!Path.ROOT.isValidPath(resourceName)) { problemType = PROBLEM_NAME_INVALID; problemMessage = NLS.bind( IDEWorkbenchMessages.ResourceGroup_invalidFilename, resourceName); return false; } return true; }
private StatusInfo pathUpdated() { StatusInfo status= new StatusInfo(); String path= fPathField.getText(); if (path.length() > 0) { // empty path is ok if (!Path.ROOT.isValidPath(path)) { status.setError(NewWizardMessages.VariableCreationDialog_error_invalidpath); } else if (!new File(path).exists()) { status.setWarning(NewWizardMessages.VariableCreationDialog_warning_pathnotexists); } } return status; }
private StatusInfo pathUpdated() { StatusInfo status= new StatusInfo(); String path= fPathField.getText(); if (path.length() > 0) { // empty path is ok if (!Path.ROOT.isValidPath(path)) { status.setError(NewWizardMessages.VariableCreationDialog_error_invalidpath); } else if (!new File(path).exists()) { status.setWarning(NewWizardMessages.VariableCreationDialog_warning_pathnotexists); } } return status; }
private StatusInfo pathUpdated() { StatusInfo status= new StatusInfo(); String path= fPathField.getText(); if (path.length() > 0) { // empty path is ok if (!Path.ROOT.isValidPath(path)) { status.setError(NewWizardMessages.VariableCreationDialog_error_invalidpath); } else if (!new File(path).exists()) { status.setWarning(NewWizardMessages.VariableCreationDialog_warning_pathnotexists); } } return status; }
final String pathString = fsPathText.getText().trim(); if (pathString.length() == 0 || !new Path("").isValidPath(pathString)) { //$NON-NLS-1$ setErrorMessage(UIText.GitCreatePatchWizard_FilesystemError); return false;
private void validateDropLocation() { String errorMessage = null; if (isOtherLocation()) { IPath curr = getDropLocation(); if (curr.segmentCount() == 0) errorMessage = PDEUIMessages.FeatureImportWizard_errors_locationMissing; else if (!Path.ROOT.isValidPath(fDropLocation.getText())) errorMessage = PDEUIMessages.FeatureImportWizard_errors_buildFolderInvalid; else { File file = curr.toFile(); if (!file.exists() || !file.isDirectory()) errorMessage = PDEUIMessages.FeatureImportWizard_errors_buildFolderMissing; } } setErrorMessage(errorMessage); setPageComplete(errorMessage == null); }
if (!Path.EMPTY.isValidPath(location)) { throw new ValidationException( null,
private void validatePath() { StatusInfo status= new StatusInfo(); String str= fEntryField.getText(); if (str.length() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_enterpath); } else if (!Path.ROOT.isValidPath(str)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_invalidpath); } else { IPath path= new Path(str); if (path.segmentCount() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_needssegment); } else if (fUsedPaths.contains(path)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_alreadyexists); } } updateStatus(status); }
private void validatePath() { StatusInfo status= new StatusInfo(); String str= fEntryField.getText(); if (str.length() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_enterpath); } else if (!Path.ROOT.isValidPath(str)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_invalidpath); } else { IPath path= new Path(str); if (path.segmentCount() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_needssegment); } else if (fUsedPaths.contains(path)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_alreadyexists); } } updateStatus(status); }
private void validatePath() { StatusInfo status= new StatusInfo(); String str= fEntryField.getText(); if (str.length() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_enterpath); } else if (!Path.ROOT.isValidPath(str)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_invalidpath); } else { IPath path= new Path(str); if (path.segmentCount() == 0) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_needssegment); } else if (fUsedPaths.contains(path)) { status.setError(NewWizardMessages.ClasspathContainerDefaultPage_path_error_alreadyexists); } } updateStatus(status); }
String jdocLocation= fArchiveField.getText(); if (jdocLocation.length() > 0) { if (!Path.ROOT.isValidPath(jdocLocation)) { status.setError(PreferencesMessages.JavadocConfigurationBlock_error_invalidarchivepath); return status;
public static String validateNewFolder(IFolder folder, String folderValue) { if ((folder == null) || (folderValue == null)) { return null; } if (CoreUtil.isNullOrEmpty(folderValue)) { return Msgs.folderValueNotEmpty; } if (!Path.ROOT.isValidPath(folderValue)) { return Msgs.folderValueInvalid; } IFolder newFolder = folder.getFolder(folderValue); IPath path = newFolder.getFullPath(); IWorkspace workspace = CoreUtil.getWorkspace(); IStatus result = workspace.validatePath(path.toString(), IResource.FOLDER); if (!result.isOK()) { return result.getMessage(); } if (exists(folder.getFolder(new Path(folderValue)))) { return Msgs.folderAlreadyExists; } return null; }
return; if (!Path.ROOT.isValidPath(importDirectory.getText())) { setErrorMessage(PDEUIMessages.ImportWizard_errors_buildFolderInvalid); setPageComplete(false);
if (!Path.EMPTY.isValidPath(fileName)) { status.setError(NewWizardMessages.AnnotationsAttachmentBlock_filename_error_notvalid); return status;