@Override public void handleRequest(DataInput input, ActiveOperation.ResultHandler<File> resultHandler, ManagementRequestContext<Void> context) throws IOException { final File localPath; switch (rootId) { case DomainControllerProtocol.PARAM_ROOT_ID_FILE: { localPath = localFileRepository.getFile(filePath); break; } case DomainControllerProtocol.PARAM_ROOT_ID_CONFIGURATION: { localPath = localFileRepository.getConfigurationFile(filePath); break; } case DomainControllerProtocol.PARAM_ROOT_ID_DEPLOYMENT: { byte[] hash = HashUtil.hexStringToByteArray(filePath); localPath = localFileRepository.getDeploymentRoot(hash); break; } default: { localPath = null; } } try { DomainRemoteFileRequestAndHandler.INSTANCE.handleResponse(input, localPath, ROOT_LOGGER, resultHandler, context); } catch (CannotCreateLocalDirectoryException e) { throw MESSAGES.cannotCreateLocalDirectory(e.getDir()); } catch (DidNotReadEntireFileException e) { throw MESSAGES.didNotReadEntireFile(e.getMissing()); } } }