Examples of toOutputStream()


Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toOutputStream()

      record = doc.field("file");
    }catch (Exception e){
      throw new DocumentIsNotAFileException("The file field exists but does not contains a valid file");
    }
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    record.toOutputStream(out);
    return out;
  }
 
  public static boolean docIsAFile(ODocument doc){
    String className=doc.getClassName();
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toOutputStream()

          String[] fileName=((String)doc.field("fileName")).split("\\.");
          filename=fileName[0] + "_" + resize + "." + (fileName.length>1?fileName[1]:"");
        }else{
          ORecordBytes record = doc.field(FileService.BINARY_FIELD_NAME);
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          record.toOutputStream(out);
          output=out.toByteArray();
        }
        response().setContentType((String)doc.field(FileService.CONTENT_TYPE_FIELD_NAME));
        response().setHeader("Content-Length", String.valueOf(output.length));
        if (download) response().setHeader("Content-Disposition", "attachment; filename=\""+URLEncoder.encode(filename,"UTF-8")+"\"");
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toOutputStream()

    FileAssetDao dao = FileAssetDao.getInstance();
    ODocument fileAsset=dao.getByName(fileAssetName);
    if (fileAsset==null) return null;
    ORecordBytes record = fileAsset.field("file");
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    record.toOutputStream(out);
    return out;
  }
 
  public static ByteArrayOutputStream getPictureAsStream (String fileAssetName) throws SqlInjectionException, IOException{
    return getFileAsStream (fileAssetName);
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ORecordBytes.toOutputStream()

    try {
      ODocument doc=AssetService.getByName(name);
      if (doc==null || doc.field("file")==null) return notFound();
      ORecordBytes record = doc.field("file");
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      record.toOutputStream(out);
      response().setContentType(AssetService.getContentType(doc));
      if(forceDownload) response().setHeader("Content-Disposition", "attachment; filename=\""+URLEncoder.encode((String)doc.field("fileName"),"UTF-8")+"\"");
      response().setHeader("Content-Length", ((Long)doc.field("contentLength")).toString());
      //return ok(new ByteArrayInputStream(out.toByteArray()));
      return ok(out.toByteArray());
View Full Code Here

Examples of org.milyn.archive.Archive.toOutputStream()

        try {
            Archive archive = createArchive(ediSpecificationReader, urn);

            // Now output the generated archive...
            archive.toOutputStream(modelSetOutStream);
        } catch (Throwable t) {
            logger.fatal("Error while generating EDI Mapping Model archive for '" + urn + "'.", t);
        } finally {
            modelSetOutStream.close();
        }
View Full Code Here

Examples of org.milyn.archive.Archive.toOutputStream()

      if ("cuscar".equals(pkg.getName()) || "invoic".equals(pkg.getName())) {
        smallerSet.add(pkg);
      }
    }
    Archive archive = SchemaConverter.INSTANCE.createArchive(smallerSet, pluginID, pathPrefix);
    archive.toOutputStream(new ZipOutputStream(new FileOutputStream(new File("./target/" + archive.getArchiveName()))));
  }

}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.