* @param directoryId : the identifier of the directory
* @return Directory
*/
public IDirectory getDirectoryById(Integer directoryId, boolean recursive) {
DirectoryImpl directory = null;
String query = "SELECT * FROM directory where directoryid=" + directoryId;
try {
startOperation();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
directory = new DirectoryImpl();
directory.setId(rs.getInt("directoryid"));
directory.setName(rs.getString("name"));
directory.setPositionInDirectory(rs.getInt("positionInDirectory"));
directory.setTimestamp(rs.getTimestamp("timestamp"));
Integer dir = rs.getInt("directory");
if ((dir != null) && (!rs.wasNull())) {
DirectoryImpl parent = new DirectoryImpl();
parent.setId(dir);
directory.setDirectory(parent);
// directory.setParentDirectory(getDirectoryById(dir));
}
}
rs.close();