Indicates the content for the file should be zipped. If only one content reference is provided, the zip
will only contain this file.
@return
the builder
353130
public ZipFileBuilder asZip() {
        final ZipFileBuilder zfb = new ZipFileBuilder(folder, filename);
        if(this.content != null) {
            zfb.addResource(getContenFileName(), this.content);
        }
        return zfb;
    }
279438
@Programmatic
    public Blob downloadLayouts() {
        final LayoutJsonExporter exporter = new LayoutJsonExporter();
        final Collection<ObjectSpecification> allSpecs = specificationLoader.allSpecifications();
        final Collection<ObjectSpecification> domainObjectSpecs = Collections2.filter(allSpecs, new Predicate<ObjectSpecification>(){
            @Override
            public boolean apply(final ObjectSpecification input) {
                return  !input.isAbstract() && 
                        !input.isService() && 
                        !input.isValue() && 
                        !input.isParentedOrFreeCollection();
            }});
        try {
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final ZipOutputStream zos = new ZipOutputStream(baos);
            final OutputStreamWriter writer = new OutputStreamWriter(zos);
            for (final ObjectSpecification objectSpec : domainObjectSpecs) {
                zos.putNextEntry(new ZipEntry(zipEntryNameFor(objectSpec)));
                writer.write(exporter.asJson(objectSpec));
                writer.flush();
                zos.closeEntry();
            }
            writer.close();
            return new Blob("layouts.zip", mimeTypeApplicationZip, baos.toByteArray());
        } catch (final IOException ex) {
            throw new FatalException("Unable to create zip of layouts", ex);
        }
    }
959531
public static <T extends ContentMeta> TreeBuilder<T> builder() {
        return new TreeBuilder<T>().base(new EmptyTree<T>());
    }
1215917
private boolean isZip(JarEntry entry) throws IOException {
        try (InputStream entryInputStream = sourceFatJar.getInputStream(entry)) {
            try (ZipInputStream zipInputStream = new ZipInputStream(entryInputStream)) {
                ZipEntry ze = zipInputStream.getNextEntry();
                if (ze == null) {
                    return false;
                }
                return true;
            }
        }
    }
5723
private void getNextFile(final InputStream is) throws IOException {
    if (is instanceof  java.util.zip.ZipInputStream) {
      ZipEntry ze = ((ZipInputStream) is).getNextEntry();
      while (ze != null && ze.isDirectory())
        ze = ((ZipInputStream) is).getNextEntry();
    }
  }
286278
private javax.jcr.Binary getBinaryContent() {
        try {
            return getProperty(JCR_DATA).getBinary();
        } catch (final PathNotFoundException e) {
            throw new PathNotFoundRuntimeException(e);
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
264428
public alluxio.grpc.ChunkOrBuilder getChunkOrBuilder() {
    if (valueCase_ == 2) {
       return (alluxio.grpc.Chunk) value_;
    }
    return alluxio.grpc.Chunk.getDefaultInstance();
  }
946374
public static Builder builder() {
    return new AutoValue_OfflineDownloadOptions.Builder()
      .uuid(UUID.randomUUID().getMostSignificantBits())
      .metadata(new byte[] {})
      .progress(0);
    // TODO user must provide a notificationOptions object
  }
251396
public com.google.protobuf.ByteString
      getNobuildFilesRegexBytes() {
    java.lang.Object ref = nobuildFilesRegex_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      nobuildFilesRegex_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1040521
public static boolean isZip(String fileName) {
		if (fileName == null) {
			return false;
		}

		String tl = fileName.toLowerCase();
		for (String element : ZIP_EXTENSIONS) {
			if (tl.endsWith(element)) {
				return true;
			}
		}
		return false;
	}
495573
public ZipMessage addEntry(String fileName, byte[] content) {
        Entry entry = new Entry(fileName);
        entry.setContent(content);
        addEntry(entry);
        return this;
    }
828567
protected XContentBuilder newBuilder() throws IndexException {
    try {
      XContentBuilder builder = XContentFactory.jsonBuilder();

      if (debug()) {
        builder = builder.prettyPrint();
      }

      return builder;
    } catch (final Throwable t) {
      throw new IndexException(t);
    }
  }
986287
public ContentAssistContext.Builder copy() {
		Builder result = builderProvider.get();
		result.copyFrom(this);
		return result;
	}
1114602
static ZipInputStream createZipInputStream(InputStream inStream, Charset charset) {
    if (charset == null)
      return new ZipInputStream(inStream);

    try {
      Constructor<ZipInputStream> constructor = ZipInputStream.class.getConstructor(new Class[] { InputStream.class, Charset.class });
      return (ZipInputStream) constructor.newInstance(new Object[] { inStream, charset });
    }
    catch (NoSuchMethodException e) {
      throw new IllegalStateException(MISSING_METHOD_PLEASE_UPGRADE, e);
    }
    catch (InstantiationException e) {
      throw new IllegalStateException(CONSTRUCTOR_MESSAGE_FOR_INPUT + e.getMessage(), e);
    }
    catch (IllegalAccessException e) {
      throw new IllegalStateException(CONSTRUCTOR_MESSAGE_FOR_INPUT + e.getMessage(), e);
    }
    catch (IllegalArgumentException e) {
      throw new IllegalStateException(CONSTRUCTOR_MESSAGE_FOR_INPUT + e.getMessage(), e);
    }
    catch (InvocationTargetException e) {
      throw new IllegalStateException(CONSTRUCTOR_MESSAGE_FOR_INPUT + e.getMessage(), e);
    }
  }
466307
public Builder toBuilder() {
		return builder()
			.name(_name)
			.desc(_description)
			.author(_author)
			.copyright(_copyright)
			.links(_links)
			.time(_time)
			.keywords(_keywords)
			.bounds(_bounds);
	}
617403
public ZipFile getZipFile(final File file) throws IOException {
        try {
            if (System.getSecurityManager() == null)
                return new ZipFile(file);
            try {
                return AccessController.doPrivileged(new PrivilegedExceptionAction<ZipFile>() {
                    @Override
                    public ZipFile run() throws IOException {
                        return new ZipFile(file);
                    }
                }, controlContext);
            } catch (PrivilegedActionException e) {
                if (e.getException() instanceof IOException)
                    throw (IOException) e.getException();
                throw (RuntimeException) e.getException();
            }
        } catch (ZipException e) {
            ZipException zipNameException = new ZipException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
            zipNameException.initCause(e);
            throw zipNameException;
        } catch (IOException e) {
            throw new IOException("Exception in opening zip file: " + file.getPath(), e); //$NON-NLS-1$
        }
    }
102384
public java.lang.String getNobuildFilesRegex() {
    java.lang.Object ref = nobuildFilesRegex_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      nobuildFilesRegex_ = s;
      return s;
    }
  }