Tabnine Logo
Content.getContentType
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: sonatype-nexus-community/nexus-repository-apt

public static String determineContentType(SnapshotItem item) {
 String ct = item.content.getContentType();
 if (ct == null) {
  switch (item.specifier.role) {
   case RELEASE_INDEX:
   case RELEASE_INLINE_INDEX:
   case PACKAGE_INDEX_RAW:
    return AptMimeTypes.TEXT;
   case RELEASE_SIG:
    return AptMimeTypes.SIGNATURE;
   case PACKAGE_INDEX_BZ2:
    return AptMimeTypes.BZIP;
   case PACKAGE_INDEX_GZ:
    return AptMimeTypes.GZIP;
  }
 }
 return ct;
}
origin: org.sonatype.nexus/nexus-repository

 private static Payload cachePayload(final Content remote) throws IOException {
  try (InputStream in = remote.openInputStream()) {
   return new BytesPayload(toByteArray(in), remote.getContentType());
  }
 }
}
org.sonatype.nexus.repository.viewContentgetContentType

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
  • close
  • getSize

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook Extensions
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