@Override public int hashCode() { final int prime = 31; int result = 1; ObjectId id = getObjectId(); result = prime * result + ( ( id == null ) ? 0 : id.hashCode() ); return result; }
protected void populateDirMap( UIRepositoryDirectory repDir ) { if ( repDir.getObjectId() != null ) { dirMap.put( repDir.getObjectId(), repDir ); for ( UIRepositoryObject obj : repDir ) { if ( obj instanceof UIRepositoryDirectory ) { populateDirMap( (UIRepositoryDirectory) obj ); } } } }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } UIRepositoryDirectory other = (UIRepositoryDirectory) obj; ObjectId id = getObjectId(); ObjectId otherId = other.getObjectId(); if ( id == null ) { if ( otherId != null ) { return false; } } else if ( !id.equals( otherId ) ) { return false; } return true; } }
/** * Check if a subdirectory already exists in the repository. * This is to help fix PDI-5202 * Since the ui directories are case insensitive, we look for a repo directory with the same name ignoring case. * If we find an existing directory, we return the name so we can use that to get hold of the directory * as it is known in the repository. * If we don't find such a directory, we return null * @param name - the name of a subdirectory * @return null if the subdirectory does not exist, or the name of the subdirectory as it is known inside the repo. * @throws KettleException */ public String checkDirNameExistsInRepo( String name ) throws KettleException { String[] dirNames = rep.getDirectoryNames( getObjectId() ); for ( String dirName : dirNames ) { if ( dirName.equalsIgnoreCase( name ) ) { return dirName; } } return null; }
public void setName( String name ) throws Exception { if ( getDirectory().getName().equalsIgnoreCase( name ) ) { return; } rep.renameRepositoryDirectory( getDirectory().getObjectId(), null, name ); // Update the object reference so the new name is displayed obj = rep.findDirectory( getObjectId() ); getParent().refresh(); }
dirMap.put( newDir.getObjectId(), newDir );
public UIRepositoryObjects getRepositoryObjects() throws KettleException { if ( getObjectId() == null ) { return new UIRepositoryObjects();