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 = PrivilegedFileHelper.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 = PrivilegedFileHelper.fileOutputStream(sf);

                  sfout.write(buffer, 0, len);
                  sfout.write(tmpBuff, 0, read);
View Full Code Here

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

         // don't send any data there (no stream, no bytes)
         super(orderNumber, null, null, null, fileCleaner, maxBufferSize, tempDirectory, true, true);

         this.maxIOBuffSize = calcMaxIOSize();

         SpoolFile sf = null;
         FileChannel sch = null;
         try
         {
            sf = SpoolFile.createTempFile("jcrvdedit", null, tempDirectory);
View Full Code Here

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

         // don't send any data there (no stream, no bytes)
         super(orderNumber, null, null, null, fileCleaner, maxBufferSize, tempDirectory, true, true);

         this.maxIOBuffSize = calcMaxIOSize();

         SpoolFile sf = SpoolFile.createTempFile("jcrvdedit", null, tempDirectory);
         OutputStream sfout = PrivilegedFileHelper.fileOutputStream(sf);
         try
         {
            byte[] tmpBuff = new byte[2048];
            int read = 0;
View Full Code Here

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

            }
            else
            {

               // switch from bytes to file/channel
               SpoolFile chf = null;
               FileChannel chch = null;
               long newIndex = 0; // first pos to write

               try
               {
View Full Code Here

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

               this.data = newBytes;
            }
            else
            {
               // switch from bytes to file/channel
               SpoolFile chf = null;
               FileChannel chch = null;
               try
               {
                  chf = SpoolFile.createTempFile("jcrvdedit", null, tempDirectory);
                  chch = new RandomAccessFile(chf, "rw").getChannel();
View Full Code Here

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

            PersistedPropertyData propertyData = (PersistedPropertyData)itemData;
            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(listFile.get(i).getAbsolutePath())));
         }

         for (int i = 0; i < listFile.size(); i++)
            fileCleaner.addFile(listFile.get(i));
      }
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, null,
                                       new SpoolFile(PrivilegedFileHelper.getAbsolutePath(pfile)), fileCleaner,
                                       maxBufferSize, null, true);
                              }
                              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.