Ejemplo n.º 1
0
        /// <summary>
        /// Prepares the working directory for a Driver in driverFolderPath.
        /// </summary>
        /// <param name="appParameters"></param>
        /// <param name="driverFolderPath"></param>
        internal void PrepareDriverFolder(AppParameters appParameters, string driverFolderPath)
        {
            // Add the appParameters into that folder structure
            _fileSets.AddJobFiles(appParameters);

            // Add the reef-bridge-client jar to the local files in the manner of JavaClientLauncher.cs.
            _fileSets.AddToLocalFiles(Directory.GetFiles(JarFolder)
                                      .Where(file => !string.IsNullOrWhiteSpace(file))
                                      .Where(jarFile => Path.GetFileName(jarFile).ToLower().StartsWith(ClientConstants.ClientJarFilePrefix)));

            InternalPrepareDriverFolder(appParameters, driverFolderPath);
        }
        /// <summary>
        /// Prepares the working directory for a Driver in driverFolderPath.
        /// </summary>
        /// <param name="appParameters"></param>
        /// <param name="driverFolderPath"></param>
        internal void PrepareDriverFolder(AppParameters appParameters, string driverFolderPath)
        {
            Logger.Log(Level.Verbose, "Preparing Driver filesystem layout in {0}", driverFolderPath);

            // Setup the folder structure
            CreateDefaultFolderStructure(appParameters, driverFolderPath);

            // Add the appParameters into that folder structure
            _fileSets.AddJobFiles(appParameters);

            // Add the reef-bridge-client jar to the global files in the manner of JavaClientLauncher.cs.
            _fileSets.AddToLocalFiles(Directory.GetFiles(JarFolder)
                                      .Where(file => !string.IsNullOrWhiteSpace(file))
                                      .Where(jarFile => Path.GetFileName(jarFile).ToLower().StartsWith(ClientConstants.ClientJarFilePrefix)));

            // Create the driver configuration
            CreateDriverConfiguration(appParameters, driverFolderPath);

            // Initiate the final copy
            _fileSets.CopyToDriverFolder(driverFolderPath);

            Logger.Log(Level.Info, "Done preparing Driver filesystem layout in {0}", driverFolderPath);
        }