public function importFromLocal($overwrite = true, $delete = false) {
        $path = $this->_data;
        $file = new File($path);
        $target = $this->findDestination($file, $overwrite);

        if (copy($path, $target)) {
            if ($delete) {
                $file->delete();
            }

            $this->_file = new File($target);

            return true;
        }

        throw new IoException(sprintf('Failed to copy %s to new location', $file->basename()));
    }
public function importFromLocal($overwrite = true, $delete = false) {
        $path = $this->_data;
        $file = new File($path);
        $target = $this->findDestination($file, $overwrite);

        if (copy($path, $target)) {
            if ($delete) {
                $file->delete();
            }

            $this->_file = new File($target);

            return true;
        }

        throw new IoException(sprintf('Failed to copy %s to new location', $file->basename()));
    }
public function importFromLocal ( $ overwrite = true , $ delete = false ) { $ path = $ this -> _data ; $ file = new File ( $ path ) ; $ target = $ this -> findDestination ( $ file , $ overwrite ) ; if ( copy ( $ path , $ target ) ) { if ( $ delete ) { $ file -> delete ( ) ; } $ this -> _file = new File ( $ target ) ; return true ; } throw new IoException ( sprintf ( 'Failed to copy %s to new location' , $ file -> basename ( ) ) ) ; }
Copy a local file to the temp directory and return a File object.

@param bool $overwrite
@param bool $delete
@return bool
@throws \Transit\Exception\IoException
Copy a local file to the temp directory and return a File object .