congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RepositoryFile.delete
Code IndexAdd Tabnine to your IDE (free)

How to use
delete
method
in
org.datacleaner.repository.RepositoryFile

Best Java code snippets using org.datacleaner.repository.RepositoryFile.delete (Showing top 10 results out of 315)

origin: org.eobjects.datacleaner/DataCleaner-monitor-services

/**
 * Delete file from repository
 *
 * @param instanceId
 * @return
 */
public boolean remove(String instanceId) {
  writeLock.lock();
  try {
    RepositoryFile configFile = componentsFolder.getFile(instanceId);
    if (configFile == null) {
      logger.info("Component with id: {} is not in store.", instanceId);
      return false;
    }
    configFile.delete();
    logger.info("Component {} was removed.", instanceId);
  } finally {
    writeLock.unlock();
  }
  return true;
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

@RequestMapping(method = RequestMethod.POST, produces = "application/json")
@ResponseBody
@RolesAllowed({ SecurityRoles.JOB_EDITOR })
public Map<String, String> deleteJob(@PathVariable("tenant") final String tenant,
    @PathVariable("job") String jobName) {
  logger.info("Request payload: {} - {}", tenant, jobName);
  jobName = jobName.replaceAll("\\+", " ");
  final TenantContext tenantContext = _contextFactory.getContext(tenant);
  final JobContext job = tenantContext.getJob(jobName);
  RepositoryFile file = job.getJobFile();
  file.delete();
  
  final RepositoryFile scheduleFile = tenantContext.getJobFolder().getFile(
      jobName + SchedulingServiceImpl.EXTENSION_SCHEDULE_XML);
  if (scheduleFile != null) {
    scheduleFile.delete();
  }
  _eventPublisher.publishEvent(new JobDeletionEvent(this, tenant, jobName));
  final Map<String, String> response = new TreeMap<String, String>();
  response.put("job", jobName);
  response.put("action", "delete");
  logger.debug("Response payload: {}", response);
  return response;
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

private void deleteChildren(RepositoryFolder folder) {
  List<RepositoryFile> files = folder.getFiles();
  for (RepositoryFile file : files) {
    file.delete();
  }
  List<RepositoryFolder> folders = folder.getFolders();
  for (RepositoryFolder subFolder : folders) {
    deleteChildren(subFolder);
    subFolder.delete();
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

/**
 * Store configuration to repository in JSON
 *
 * @param configuration
 */
public void store(final ComponentStoreHolder configuration) {
  logger.info("Store component with id: {}", configuration.getInstanceId());
  writeLock.lock();
  RepositoryFile configFile = componentsFolder.getFile(configuration.getInstanceId());
  if (configFile != null) {
    // I must delete old file.
    configFile.delete();
  }
  try {
    componentsFolder.createFile(configuration.getInstanceId(), new Action<OutputStream>() {
      @Override
      public void run(OutputStream fileOutput) throws Exception {
        String jsonConf = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(
            configuration);
        InputStream jsonConfStream = IOUtils.toInputStream(jsonConf);
        FileHelper.copy(jsonConfStream, fileOutput);
      }
    });
  } finally {
    writeLock.unlock();
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  private void renameSchedule(final RepositoryFile oldScheduleFile, final String nameInput, final RepositoryFolder jobFolder) {
    final String newScheduleFilename = nameInput + SchedulingServiceImpl.EXTENSION_SCHEDULE_XML;

    final Action<OutputStream> writeScheduleAction = new Action<OutputStream>() {
      @Override
      public void run(final OutputStream out) throws Exception {
        oldScheduleFile.readFile(new Action<InputStream>() {
          @Override
          public void run(final InputStream in) throws Exception {
            FileHelper.copy(in, out);
          }
        });
      }
    };
    final RepositoryFile newScheduleFile = jobFolder.getFile(newScheduleFilename);
    if (newScheduleFile == null) {
      jobFolder.createFile(newScheduleFilename, writeScheduleAction);
    } else {
      newScheduleFile.writeFile(writeScheduleAction);
    }

    oldScheduleFile.delete();
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  @Override
  public void onApplicationEvent(JobDeletionEvent event) {
    final TenantIdentifier tenantIdentifier = new TenantIdentifier(event.getTenant());
    final JobIdentifier jobIdentifier = new JobIdentifier(event.getJobName());

    final List<RepositoryFile> results = resultDao.getResultsForJob(tenantIdentifier, jobIdentifier);
    for (RepositoryFile repositoryFile : results) {
      repositoryFile.delete();
    }
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

existingFile.delete();
origin: datacleaner/DataCleaner

  public static void main(final String[] args) {
    final DCModuleImpl module = new DCModuleImpl(DataCleanerHome.get());
    final DataCleanerConfiguration configuration =
        Guice.createInjector(module).getInstance(DataCleanerConfiguration.class);

    final ComponentReferenceDocumentationBuilder docBuilder =
        new ComponentReferenceDocumentationBuilder(configuration.getEnvironment().getDescriptorProvider());
    final RepositoryFolder folder =
        configuration.getHomeFolder().toRepositoryFolder().getOrCreateFolder("documentation");

    // clean up the directory
    final List<RepositoryFile> htmlFiles = folder.getFiles(null, ".html");
    for (final RepositoryFile file : htmlFiles) {
      file.delete();
    }

    docBuilder.writeDocumentationToRepositoryFolder(folder);

    System.out.println("Documentation written to: " + folder.getQualifiedPath());
  }
}
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

  newFile.writeFile(writeAction);
existingFile.delete();
origin: org.eobjects.datacleaner/DataCleaner-monitor-services

oldFile.delete();
org.datacleaner.repositoryRepositoryFiledelete

Popular methods of RepositoryFile

  • writeFile
    Opens up an OutputStream to write to the file.
  • getLastModified
  • getName
  • getQualifiedPath
  • getSize
  • readFile
  • getType
  • toResource

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • Path (java.nio.file)
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JFrame (javax.swing)
  • JList (javax.swing)
  • Option (scala)
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now