class CustomProcessorUploadHandler implements FileEventHandler {

    @Override
    public void created (Path path) {
        File createdFile = path.toFile();
        LOG.info("Created called with " + createdFile);
        boolean succeeded = false;
        try {
            if (createdFile.getName().endsWith(".tar")) {
                LOG.info("Processing file at " + path);
                CustomProcessorInfo customProcessorInfo = this.getCustomProcessorInfo(createdFile);
                if (customProcessorInfo == null) {
                    LOG.warn("No information found for CustomProcessorRuntime in " + createdFile);
                    return;
                }
                InputStream jarFile = this.getJarFile(createdFile);
                if (jarFile == null) {
                    LOG.warn("No jar file found for CustomProcessorRuntime in " + createdFile);
                    return;
                }
                this.catalogService.addCustomProcessorInfoAsBundle(customProcessorInfo, jarFile);
                succeeded = true;
            } else {
                LOG.info("Failing unsupported file that was received: " + path);
            }
        } catch (IOException e) {
            LOG.warn("Exception occured while processing tar file: " + createdFile, e);
        } catch (ComponentConfigException e) {
            LOG.warn("UI specification for custom processor incorrect for custom processor file: " + createdFile, e);
        } catch (NoSuchAlgorithmException e) {
            LOG.warn("Got NoSuchAlgorithmException while calculating digest for jar: " + createdFile, e);
        } finally {
            try {
                if (succeeded) {
                    LOG.info("CustomProcessorRuntime uploaded successfully from  " + createdFile + " Moving file to " + uploadSuccessPath);
                    moveFileToSuccessDirectory(createdFile);
                } else {
                    LOG.warn("CustomProcessorRuntime failed to upload from " + createdFile + " Moving file to " + uploadFailPath);
                    moveFileToFailDirectory(createdFile);
                }
            } catch (IOException e1) {
                LOG.warn("Error moving " + createdFile.getAbsolutePath() + " to " + (succeeded ? uploadSuccessPath : uploadFailPath), e1);
            }
        }
    }

    public  CustomProcessorUploadHandler(String watchPath, String uploadFailPath, String uploadSuccessPath, StreamCatalogService catalogService);

}