View a form to move a specific {@link DataArchive}.
760444
public function movesnapshot($request) {
		$dataArchive = DNDataArchive::get()->byId($request->param('DataArchiveID'));

		if(!$dataArchive) {
			throw new SS_HTTPResponse_Exception('Archive not found', 404);
		}

		// We check for canDownload because that implies access to the data.
		if(!$dataArchive->canDownload()) {
			throw new SS_HTTPResponse_Exception('Not allowed to access archive', 403);
		}

		$form = $this->getMoveForm($this->request, $dataArchive);

		// View currently only available via ajax
		return $form->forTemplate();
	}
1315044
public function disArchiveFiles()
    {
        $properties     = $this->getProperties();
        $acceptedFiles  = $properties['acceptedFiles'];
        $archExt        = $this->getArchiveExtensionConstant();
        $acceptedFiles  = $this->rmAcceptedFiles($acceptedFiles, $archExt);
        $properties['acceptedFiles']    = $acceptedFiles;
        $this->setProperties($properties);
        return $this;
    }
109579
private void moveOldStructure() throws Exception
   {
      ExtendedSession session = (ExtendedSession)service.getStorageSession();
      try
      {
         if (session.itemExists(storagePathOld))
         {
            return;
         }
         else
         {
            session.move(service.getStoragePath(), storagePathOld, false);
            session.save();
         }
      }
      finally
      {
         session.logout();
      }
   }
1244754
public Record moveRecordToBase(Record record)
    {
        SharedBaseRecordTable sharedTable = this.getSharedTable();
        sharedTable.setCurrentRecord(record);
        boolean bCopyEditMode = false;
        boolean bOnlyModifiedFields = false;
        Record recBase = sharedTable.getBaseRecord();
        sharedTable.copyRecordInfo(recBase, record, bCopyEditMode, bOnlyModifiedFields);
        return recBase;
    }
132945
private boolean moveToNextDataSegment() throws IOException {
    try {
      clearDataSegment();
      DataSegmentReader dataSegmentReader =
          new DataSegmentReader(dataIn, conf, decompressorCache);
      dataSegmentIn = dataSegmentReader.getInputStream();
    } catch (EmptyDataSegmentException e){
      // no data available
      return false;
    } catch (EOFException e) {
      // EOFException is thrown when the underlying data stream is truncated, e.g. truncated file.
      // This is considered as a normal case.
      throw new CodecPrematureEOFException("Truncated .SSF file detected.");
    } catch (ClassNotFoundException e) {
      throw new RuntimeException(e);
    }
    return true;
  }
446775
function getDocsToArchive(criteria, primaryCollection) {
        var deferred = Q.defer();

        primaryCollection.find(criteria).toArray(function (err, items) {
            err ? deferred.reject(err) : deferred.resolve(items);
        });

        return deferred.promise;
    }
305382
@Override
    public T move(String source, String target) throws IllegalArgumentException, IllegalArchivePathException {
        Validate.notNullOrEmpty(source, "The source path was not specified");
        Validate.notNullOrEmpty(target, "The target path was not specified");

        final ArchivePath sourcePath = new BasicPath(source);
        final ArchivePath targetPath = new BasicPath(target);

        return move(sourcePath, targetPath);
    }
1200227
private void importDataArchive(
            final Resource resource,
            final ArchiveInputStream resourceStream,
            BatchImportOptions options) {

        final File tempDir = Files.createTempDir();
        try {
            ArchiveEntry archiveEntry;
            while ((archiveEntry = resourceStream.getNextEntry()) != null) {
                final File entryFile = new File(tempDir, archiveEntry.getName());
                if (!archiveEntry.isDirectory()) {
                    entryFile.getParentFile().mkdirs();
                    IOUtils.copy(
                            new CloseShieldInputStream(resourceStream),
                            new FileOutputStream(entryFile));
                }
            }

            importDataDirectory(tempDir, null, options);
        } catch (IOException e) {
            throw new RuntimeException(
                    "Failed to extract data from '"
                            + resource
                            + "' to '"
                            + tempDir
                            + "' for batch import.",
                    e);
        } finally {
            FileUtils.deleteQuietly(tempDir);
        }
    }
926393
public FieldList move(int iRelPosition) throws DBException
    {
        if (!m_bIsOpen)
            this.open();        // This will requery the table the first time
        this.getRecord().setEditMode(Constants.EDIT_NONE);
        int iRecordStatus = this.doMove(iRelPosition);
        if (iRecordStatus == Constants.NORMAL_RETURN)
        {
            this.dataToFields(this.getRecord());
            //  Usually, you would setDataSource(null), but if in hasNext(), you will need the dataSource.
            this.getRecord().setEditMode(Constants.EDIT_CURRENT);
            return m_record;
        }
        else
            return null;    // Usually EOF
    }
216430
public Object moveToNextValue(Object val) throws SQLException {
		if (dataPersister == null) {
			return null;
		} else {
			return dataPersister.moveToNextValue(val);
		}
	}
640057
public void viewDocument(DocumentEntry entry)
   {
      InputStream is = null;

      try
      {
         is = new DocumentInputStream(entry);
         byte[] data = new byte[is.available()];
         is.read(data);
         m_model.setData(data);
         updateTables();
      }

      catch (IOException ex)
      {
         throw new RuntimeException(ex);
      }

      finally
      {
         StreamHelper.closeQuietly(is);
      }

   }
765116
function exportFilesystemToArchive (opts, cb) {
  return maybe(cb, async function () {
    assert(opts && typeof opts === 'object', 'opts object is required')

    // core arguments, srcPath and dstArchive
    var srcPath = opts.srcPath
    var dstArchive = opts.dstArchive
    assert(srcPath && typeof srcPath === 'string', 'srcPath is required')
    assert(dstArchive && typeof dstArchive === 'object', 'dstArchive is required')

    // options
    var dstPath = typeof opts.dstPath === 'string' ? opts.dstPath : '/'
    var ignore = Array.isArray(opts.ignore) ? opts.ignore : DEFAULT_IGNORE
    var inplaceImport = opts.inplaceImport === true
    var dryRun = opts.dryRun === true

    // ensure we have the archive's private key
    if (!dstArchive.writable && !dryRun) {
      throw new ArchiveNotWritableError()
    }

    // make source the source exists
    var srcStat
    try {
      srcStat = await fse.stat(srcPath)
    } catch (e) {
      throw new SourceNotFoundError(e.toString())
    }

    // if reading from a directory, and not doing an implace-import,
    // then put the dstPath at a subpath so that the folder's contents dont
    // get imported in-place into the archive
    if (srcStat.isDirectory() && !inplaceImport) {
      dstPath = path.join(dstPath, path.basename(srcPath))
    }

    // make sure the destination is a folder
    var dstStat
    try { dstStat = await stat(dstArchive, dstPath) } catch (e) {}
    if (!dstStat) {
      try { dstStat = await stat(dstArchive, path.dirname(dstPath)) } catch (e) {}
    }
    if (!dstStat || !dstStat.isDirectory()) {
      throw new ParentFolderDoesntExistError()
    }

    // dont overwrite directories with files
    if (!srcStat.isDirectory() && dstStat.isDirectory()) {
      dstPath = path.join(dstPath, path.basename(srcPath))
    }

    const statThenExport = async function (srcPath, dstPath) {
      // apply ignore filter
      if (ignore && match(ignore, srcPath)) {
        return
      }

      // export by type
      var srcStat = await fse.stat(srcPath)
      if (srcStat.isFile()) {
        await exportFile(srcPath, srcStat, dstPath)
      } else if (srcStat.isDirectory()) {
        await exportDirectory(srcPath, dstPath)
      }
    }

    const exportFile = async function (srcPath, srcStat, dstPath) {
      // fetch dest stats
      var dstFileStats = null
      try {
        dstFileStats = await stat(dstArchive, dstPath)
      } catch (e) {}

      // track the stats
      stats.fileCount++
      stats.totalSize += srcStat.size || 0
      if (dstFileStats) {
        if (dstFileStats.isDirectory()) {
          // delete the directory-tree
          if (!dryRun) await rmdir(dstArchive, dstPath, {recursive: true})
          stats.removedFolders.push(dstPath)
          stats.addedFiles.push(dstPath)
        } else {
          stats.updatedFiles.push(dstPath)
        }
      } else {
        stats.addedFiles.push(dstPath)
      }

      // write the file
      if (dryRun) return
      return new Promise((resolve, reject) => {
        pump(
          fse.createReadStream(srcPath),
          dstArchive.createWriteStream(dstPath),
          err => {
            if (err) reject(err)
            else resolve()
          }
        )
      })
    }

    const exportDirectory = async function (srcPath, dstPath) {
      // make sure the destination folder exists
      var dstStat
      try { dstStat = await stat(dstArchive, dstPath) } catch (e) {}
      if (!dstStat) {
        if (!dryRun) await mkdir(dstArchive, dstPath)
        stats.addedFolders.push(dstPath)
      } else if (dstStat.isFile()) {
        // a file is at the same location, remove it and add the folder
        if (!dryRun) {
          await unlink(dstArchive, dstPath)
          await mkdir(dstArchive, dstPath)
        }
        stats.addedFolders.push(dstPath)
        stats.removedFiles.push(dstPath)
        if (dryRun) {
          // dont recurse on a dry run -- not possible because the actual changes arent being made
          return
        }
      }

      // list the directory
      var fileNames = await fse.readdir(srcPath)

      // recurse into each
      var promises = fileNames.map(name => {
        return statThenExport(path.join(srcPath, name), path.join(dstPath, name))
      })
      await Promise.all(promises)
    }

    // recursively export
    var stats = {
      addedFiles: [],
      addedFolders: [],
      updatedFiles: [],
      removedFiles: [],
      removedFolders: [],
      skipCount: 0,
      fileCount: 0,
      totalSize: 0
    }
    await statThenExport(srcPath, dstPath)
    return stats
  })
}
786070
static void move(File src, File dest) throws IOException {
        try {
            Files.move(src.toPath(), dest.toPath());
        } catch (IOException x) {
            throw x;
        } catch (Exception x) {
            throw new IOException(x);
        }
    }
877177
void moveData(Session session, Table from, int colindex, int adjust) {

        Object       colvalue = null;
        ColumnSchema column   = null;

        if (adjust >= 0 && colindex != -1) {
            column   = getColumn(colindex);
            colvalue = column.getDefaultValue(session);
        }

        PersistentStore store = session.sessionData.getRowStore(this);

        try {
            RowIterator it = from.rowIterator(session);

            while (it.hasNext()) {
                Row      row  = it.getNextRow();
                Object[] o    = row.getData();
                Object[] data = getEmptyRowData();

                if (adjust == 0 && colindex != -1) {
                    colvalue = column.getDataType().convertToType(session,
                            o[colindex],
                            from.getColumn(colindex).getDataType());
                }

                ArrayUtil.copyAdjustArray(o, data, colvalue, colindex, adjust);
                systemSetIdentityColumn(session, data);
                enforceRowConstraints(session, data);

                // get object without RowAction
                Row newrow = (Row) store.getNewCachedObject(null, data);

                if (row.rowAction != null) {
                    newrow.rowAction =
                        row.rowAction.duplicate(newrow.getPos());
                }

                store.indexRow(null, newrow);
            }
            this.timeToLive = from.timeToLive;
        } catch (Throwable t) {
            store.release();

            if (t instanceof HsqlException) {
                throw (HsqlException) t;
            }

            throw new HsqlException(t, "", 0);
        }
    }
27579
public function moveToArchive($bulk = false)
    {
        $this->connection->transact(function () use ($bulk) {
            $this->triggerEvent('on_before_move_to_archive', [$bulk]);

            if ($bulk && method_exists($this, 'setOriginalIsArchived')) {
                $this->setOriginalIsArchived($this->getIsArchived());
            }

            $this->setIsArchived(true);
            $this->save();

            $this->triggerEvent('on_after_move_to_archive', [$bulk]);
        });
    }
920483
String storedForm() {
        return entries.stream()
                .map(sue -> sue.storedForm())
                .collect(joining());
    }
982508
protected function submitFileManager()
    {
        if ($this->data_access) {
            if ($this->isPosted('process_selected')) {
                $this->submitSelectedFileManager();
            } else if ($this->isPosted('submit') && $this->validateFileManager()) {
                $this->submitCommandFileManager();
            }
        }
    }