Codota Logo
ResourceAwareItemWriterItemStream.setResource
Code IndexAdd Codota to your IDE (free)

How to use
setResource
method
in
org.springframework.batch.item.file.ResourceAwareItemWriterItemStream

Best Java code snippets using org.springframework.batch.item.file.ResourceAwareItemWriterItemStream.setResource (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-batch

  /**
   * Create output resource (if necessary) and point the delegate to it.
   */
  private File setResourceToDelegate() throws IOException {
    String path = resource.getFile().getAbsolutePath() + suffixCreator.getSuffix(resourceIndex);
    File file = new File(path);
    delegate.setResource(new FileSystemResource(file));
    return file;
  }
}
origin: com.github.almex/raildelays-batch

/**
 * Create output resource (if necessary) and point the delegate to it.
 */
private File setResourceToDelegate() throws IOException {
  resource = resourceLocator.getResource(executionContext);
  delegate.setResource(resource);
  LOGGER.debug("Setting resource={} to delegate", resource != null ? resource.getFile().getAbsolutePath() : "null");
  return resource.getFile();
}
origin: com.github.almex/raildelays-batch

private void initializeStreams() throws Exception {
  if (createBackupFile) {
    outputResource = new FileSystemResource(File.createTempFile(resource.getFilename(), ".tmp", resource.getFile().getParentFile()));
  } else {
    outputResource = resource;
  }
  reader.setResource(resource);
  writer.setResource(outputResource);
}
origin: apache/servicemix-bundles

  /**
   * Create output resource (if necessary) and point the delegate to it.
   */
  private File setResourceToDelegate() throws IOException {
    String path = resource.getFile().getAbsolutePath() + suffixCreator.getSuffix(resourceIndex);
    File file = new File(path);
    delegate.setResource(new FileSystemResource(file));
    return file;
  }
}
origin: com.github.almex/raildelays-batch

@Override
public void write(List<? extends ExcelRow> items) throws Exception {
  if (!initialized && items.size() > 0) {
    SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
    String suffix = format.format(items.get(0).getDate());
    File file = ExcelFileUtils.getFile(new File(directoryPath), fileName, suffix, fileExtension);
    delegate.setResource(new FileSystemResource(file));
    delegate.open(executionContext);
    initialized = true;
  }
  delegate.write(items);
}
origin: com.github.almex/raildelays-batch

@Override
protected void doOpen() throws Exception {
  if (executionContext.containsKey(getExecutionContextKey(RESOURCE_KEY))) {
    resource = new FileSystemResource(executionContext.getString(getExecutionContextKey(RESOURCE_KEY), ""));
    // It's a restart
    delegate.open(executionContext);
    delegate.setResource(resource);
    // We don't have to create the resource
    opened = true;
    LOGGER.trace("Stream is opened");
  } else {
    opened = false;
    LOGGER.trace("Stream is not opened yet");
  }
}
org.springframework.batch.item.fileResourceAwareItemWriterItemStreamsetResource

Popular methods of ResourceAwareItemWriterItemStream

  • close
  • open
  • update
  • write

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now