Codota Logo
Content.close
Code IndexAdd Codota to your IDE (free)

How to use
close
method
in
org.sonatype.nexus.repository.view.Content

Best Java code snippets using org.sonatype.nexus.repository.view.Content.close (Showing top 1 results out of 315)

  • Common ways to obtain Content
private void myMethod () {
Content c =
  • Codota IconBlob blob;Asset asset;new Content(new BlobPayload(blob, asset.requireContentType()))
  • Smart code suggestions by Codota
}
origin: sonatype-nexus-community/nexus-repository-apt

@Transactional(retryOn = { ONeedRetryException.class })
@Override
public void createSnapshot(String id, SnapshotComponentSelector selector) throws IOException {
 StorageTx tx = UnitOfWork.currentTx();
 StorageFacet storageFacet = facet(StorageFacet.class);
 Bucket bucket = tx.findBucket(getRepository());
 Component component = tx.createComponent(bucket, getRepository().getFormat()).name(id);
 tx.saveComponent(component);
 for (SnapshotItem item : collectSnapshotItems(selector)) {
  String assetName = createAssetPath(id, item.specifier.path);
  Asset asset = tx.createAsset(bucket, component).name(assetName);
  try (final TempBlob streamSupplier = storageFacet.createTempBlob(item.content.openInputStream(), FacetHelper.hashAlgorithms)) {
   AssetBlob blob = tx.createBlob(item.specifier.path, streamSupplier, FacetHelper.hashAlgorithms, null,
     FacetHelper.determineContentType(item), true);
   tx.attachBlob(asset, blob);
  }
  finally {
   item.content.close();
  }
  tx.saveAsset(asset);
 }
}
org.sonatype.nexus.repository.viewContentclose

Popular methods of Content

  • <init>
  • getAttributes
  • applyToAsset
    Applies non-format specific content attributes onto passed in Asset from passed in AttributesMap(usu
  • extractFromAsset
    Extracts non-format specific content attributes into the passed in AttributesMap (usually originatin
  • findAsset
    Finds fresh Asset instance from passed in TX by entity ID of the Asset used to create passed in Cont
  • maintainLastModified
    Maintains the "last modified" attribute of the content by setting it to "now". It accepts nulls, and
  • openInputStream
  • getContentType
  • getSize

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
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