@Override
    public ApplicationPackage preprocess(Zone zone, DeployLogger logger) throws IOException {
        java.nio.file.Path tempDir = null;
        try {
            tempDir = Files.createTempDirectory(appDir.getParentFile().toPath(), "preprocess-tempdir");
            preprocess(appDir, tempDir.toFile(), zone);
            IOUtils.recursiveDeleteDir(preprocessedDir);
            // Use 'move' to make sure we do this atomically, important to avoid writing only partial content e.g.
            // when shutting down.
            // Temp directory needs to be on the same file system as appDir for 'move' to work,
            // if it fails (with DirectoryNotEmptyException (!)) we need to use 'copy' instead
            // (this will always be the case for the application package for a standalone container).
            Files.move(tempDir, preprocessedDir.toPath());
            tempDir = null;
        } catch (AccessDeniedException | DirectoryNotEmptyException e) {
            preprocess(appDir, preprocessedDir, zone);
        } finally {
            if (tempDir != null)
                IOUtils.recursiveDeleteDir(tempDir.toFile());
        }
        FilesApplicationPackage preprocessedApp = fromFile(preprocessedDir, includeSourceFiles);
        preprocessedApp.copyUserDefsIntoApplication();
        return preprocessedApp;
    }
Reads a ranking expression from file to a string and returns it.

@param name the name of the file to return,
            relative to the search definition directory in the application package
@return the content of a ranking expression file
@throws IllegalArgumentException if the file was not found or could not be read
config-application-package/src/main/java/com/yahoo/config/model/application/provider/FilesApplicationPackage.java