Examples of SpoolFile


Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

      OutputStream sfout = null;
      int read = 0;

      try
      {
         SpoolFile sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
         sf.acquire(this);
         sfout = new FileOutputStream(sf);

         while ((read = tmpStream.read(tmpBuff)) >= 0)
            sfout.write(tmpBuff, 0, read);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

      byte[] buffer = new byte[0];
      byte[] tmpBuff = new byte[2048];
      int read = 0;
      int len = 0;
      SpoolFile sf = null;
      OutputStream sfout = null;

      try
      {
         while ((read = tmpStream.read(tmpBuff)) >= 0)
         {
            if (sfout != null)
            {
               // spool to temp file
               sfout.write(tmpBuff, 0, read);
               len += read;
            }
            else if (len + read > maxBufferSize && fileCleaner != null)
            {
               // threshold for keeping data in memory exceeded,
               // if have a fileCleaner create temp file and spool buffer contents.
               sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
               sf.acquire(this);

               sfout = new FileOutputStream(sf);
               sfout.write(buffer, 0, len);
               sfout.write(tmpBuff, 0, read);
               buffer = null;
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

         OutputStream sfout = null;
         int read = 0;

         try
         {
            SpoolFile sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
            sf.acquire(this);
            sfout = new FileOutputStream(sf);

            while ((read = tmpStream.read(tmpBuff)) >= 0)
               sfout.write(tmpBuff, 0, read);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

         byte[] buffer = new byte[0];
         byte[] tmpBuff = new byte[2048];
         int read = 0;
         int len = 0;
         SpoolFile sf = null;
         OutputStream sfout = null;

         try
         {
            while ((read = tmpStream.read(tmpBuff)) >= 0)
            {
               if (sfout != null)
               {
                  // spool to temp file
                  sfout.write(tmpBuff, 0, read);
                  len += read;
               }
               else if (len + read > maxBufferSize && fileCleaner != null)
               {
                  // threshold for keeping data in memory exceeded,
                  // if have a fileCleaner create temp file and spool buffer contents.
                  sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
                  sf.acquire(this);

                  sfout = new FileOutputStream(sf);
                  sfout.write(buffer, 0, len);
                  sfout.write(tmpBuff, 0, read);
                  buffer = null;
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

    */
   public void addNewStream(FixupStream fs) throws IOException
   {
      this.getFixupStreams().add(fs);

      SpoolFile f = SpoolFile.createTempFile("tempFile" + IdGenerator.generate(), ".tmp", tempDir);

      this.getListFile().add(f);
      this.getListRandomAccessFiles().add(PrivilegedFileHelper.randomAccessFile(f, "rw"));

   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

         ValueData vd = (propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));

         // re-init the value
         propertyData.getValues().set(
            listFixupStream.get(i).getValueDataId(),
            new StreamPersistedValueData(vd.getOrderNumber(), new SpoolFile(PrivilegedFileHelper
               .getAbsolutePath(listFile.get(i)))));
      }

      if (listRandomAccessFile != null)
         for (int i = 0; i < listRandomAccessFile.size(); i++)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

         OutputStream sfout = null;
         int read = 0;

         try
         {
            SpoolFile sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
            sf.acquire(this);
            sfout = new FileOutputStream(sf);

            while ((read = tmpStream.read(tmpBuff)) >= 0)
               sfout.write(tmpBuff, 0, read);
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

         byte[] buffer = new byte[0];
         byte[] tmpBuff = new byte[2048];
         int read = 0;
         int len = 0;
         SpoolFile sf = null;
         OutputStream sfout = null;

         try
         {
            while ((read = tmpStream.read(tmpBuff)) >= 0)
            {
               if (sfout != null)
               {
                  // spool to temp file
                  sfout.write(tmpBuff, 0, read);
                  len += read;
               }
               else if (len + read > maxBufferSize && fileCleaner != null)
               {
                  // threshold for keeping data in memory exceeded,
                  // if have a fileCleaner create temp file and spool buffer contents.
                  sf = SpoolFile.createTempFile("jcrvd", null, tempDirectory);
                  sf.acquire(this);

                  sfout = new FileOutputStream(sf);
                  sfout.write(buffer, 0, len);
                  sfout.write(tmpBuff, 0, read);
                  buffer = null;
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

    */
   public void addNewStream(FixupStream fs) throws IOException
   {
      this.getFixupStreams().add(fs);

      SpoolFile f = SpoolFile.createTempFile("tempFile" + IdGenerator.generate(), ".tmp", tempDir);

      this.getListFile().add(f);
      this.getListRandomAccessFiles().add(PrivilegedFileHelper.randomAccessFile(f, "rw"));

   }
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.util.io.SpoolFile

                              File pfile = propertyValue.getFile();
                              if (pfile != null)
                              {
                                 vdata =
                                    new TransientValueData(currentProperty.getValues().size(), null, new SpoolFile(
                                       PrivilegedFileHelper.getAbsolutePath(pfile)), spoolConfig);
                              }
                              else
                              {
                                 vdata = new TransientValueData(currentProperty.getValues().size(), new byte[]{});
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.