* @return A jax-rs Response object with the appropriate status code, header, and body.
*/
public boolean doCreateDir( String pathId ) {
String path = idToPath( pathId );
String[] folders = path.split( "[" + FileUtils.PATH_SEPARATOR + "]" ); //$NON-NLS-1$//$NON-NLS-2$
RepositoryFileDto parentDir = getRepoWs().getFile( FileUtils.PATH_SEPARATOR );
boolean dirCreated = false;
for ( String folder : folders ) {
String currentFolderPath = ( parentDir.getPath() + FileUtils.PATH_SEPARATOR + folder ).substring( 1 );
if ( !currentFolderPath.startsWith( FileUtils.PATH_SEPARATOR ) ) {
currentFolderPath = FileUtils.PATH_SEPARATOR + currentFolderPath;
}
RepositoryFileDto currentFolder = getRepoWs().getFile( currentFolderPath );
if ( currentFolder == null ) {
currentFolder = new RepositoryFileDto();
currentFolder.setFolder( true );
currentFolder.setName( decode( folder ) );
currentFolder.setPath( parentDir.getPath() + FileUtils.PATH_SEPARATOR + folder );
currentFolder = getRepoWs().createFolder( parentDir.getId(), currentFolder, currentFolderPath );
dirCreated = true;
}
parentDir = currentFolder;
}