userProfile = profileManager.getUserProfile(getID(), false);
} catch (GetFailedException | NoSessionException e) {
throw new ProcessExecutionException(e);
}
Index index = userProfile.getFileById(context.getFileKey());
if (index == null) {
throw new ProcessExecutionException("File key not found in user profile.");
}
context.provideIndex(index);
// add the next steps here
if (index.isFolder()) {
logger.info("No download of the file needed since '{}' is a folder.", index.getFullPath());
getParent().add(new CreateFolderStep(context, networkManager));
} else {
logger.info("Initalize the process for downloading file '{}'.", index.getFullPath());
try {
IDataManager dataManager = networkManager.getDataManager();
getParent().add(new GetMetaFileStep(context, context, dataManager));
PeerAddress ownPeerAddress = networkManager.getConnection().getPeer().getPeerAddress();
getParent().add(