Save a copy reference to the user's Dropbox.

 @param [String] copy_reference
 @param [String] path
 @return [Dropbox::Metadata] metadata
490903
def save_copy_reference(copy_reference, path)
      resp = request('/files/copy_reference/save', copy_reference: copy_reference, path: path)
      parse_tagged_response(resp['metadata'])
    end
110942
def render_copy from_source_path
      source_path = "#{ActiveCopy.content_path}/#{from_source_path}.md"

      if File.exists? source_path
        raw_source = IO.read source_path
        source = raw_source.split("---\n")[2]
        template = ActiveCopy::Markdown.new
        template.render(source).html_safe
      else
        raise ArgumentError.new "#{source_path} does not exist."
      end
    end
903020
def save(path)

      Dir.mkdir(path) unless File.exists?(path)
      project_filepath = "#{path}/project.pbxproj"

      # @toodo Save the workspace when the project is saved
      # FileUtils.cp_r "#{path}/project.xcworkspace", "#{path}/project.xcworkspace"

      Xcode::PLUTILProjectParser.save "#{path}/project.pbxproj", to_xcplist

    end
689974
def pullPath_copy(self, d_msg, **kwargs):
        

        # Parse "header" information
        d_meta              = d_msg['meta']
        d_local             = d_meta['local']
        str_localPath       = d_local['path']
        d_remote            = d_meta['remote']
        d_transport         = d_meta['transport']
        d_copy              = d_transport['copy']

        # Pull the actual data into a dictionary holder
        d_curl                      = {}
        d_curl['remoteServer']      = self.pullPath_core()
        d_curl['copy']              = {}
        d_curl['copy']['status']    = d_curl['remoteServer']['status']
        if not d_curl['copy']['status']:
            d_curl['copy']['msg']   = "Copy on remote server failed!"
        else:
            d_curl['copy']['msg']   = "Copy on remote server success!"

        return d_curl
254993
def save_dir(key, dir_path, *refs):
    
    if not os.path.isdir(dir_path):
        return error(
            "Output '{}' set to a missing directory: '{}'.".format(key, dir_path)
        )

    result = {key: {"dir": dir_path}}

    if refs:
        missing_refs = [
            ref for ref in refs if not (os.path.isfile(ref) or os.path.isdir(ref))
        ]
        if len(missing_refs) > 0:
            return error(
                "Output '{}' set to missing references: '{}'.".format(
                    key, ', '.join(missing_refs)
                )
            )
        result[key]["refs"] = refs

    return json.dumps(result)
202232
def put(path, options = {})
      ext = options[:ext] || File.extname(path)
      path = path.to_s
      resp = http_post("/v1/#{appkey}",
                       File.open(path.start_with?('/') ? path : fpath(path)).read,
                       :params => {
                         :suffix => ext,
                         :simple_name => options[:simple_name] || 0
                       },
                       :accept => :json)

      json = JSON.parse(resp)
      json && json['TFS_FILE_NAME']
    end
896288
def copy_files(self):
        
        files = [u'LICENSE', u'CONTRIBUTING.rst']
        this_dir = dirname(abspath(__file__))
        for _file in files:
            sh.cp(
                '{0}/templates/{1}'.format(this_dir, _file),
                '{0}/'.format(self.book.local_path)
            )

        # copy metadata rdf file
        if self.book.meta.rdf_path: # if None, meta is from yaml file
            sh.cp(
                self.book.meta.rdf_path,
                '{0}/'.format(self.book.local_path)
            )
            
        if 'GITenberg' not in self.book.meta.subjects:
            if not self.book.meta.subjects:
                self.book.meta.metadata['subjects'] = []
            self.book.meta.metadata['subjects'].append('GITenberg')
        self.save_meta()
1037231
def clone_with_copy(src_path, dest_path):
    
    log.info('Cloning directory tree %s to %s', src_path, dest_path)
    shutil.copytree(src_path, dest_path)
171661
def copy_path_to_clipboard(self):
        
        path = self.get_current_path()
        QtWidgets.QApplication.clipboard().setText(path)
        debug('path copied: %s' % path)
1373409
def save_metadata(self, file_path):
    
    data = self.metadata
    with open(file_path, 'w')  as out_file:
      json.dump(data, out_file)
299687
function copyFileSync(sourcePath, destPath) {
  var data = fs.readFileSync(sourcePath);
  var stat = fs.statSync(sourcePath);
  fs.writeFileSync(destPath, data);
  fs.chmodSync(destPath, stat.mode);
}
1195947
def put(self, source, rel_path, metadata=None):
        '''

        '''

        # This case should probably be deprecated.
        if not isinstance(rel_path, basestring):
            rel_path = rel_path.cache_key

        sink = self.put_stream(rel_path, metadata=metadata)

        try:
            copy_file_or_flo(source, sink)
        except (KeyboardInterrupt, SystemExit):
            path_ = self.path(rel_path)
            if os.path.exists(path_):
                os.remove(path_)
            raise

        sink.close()

        return os.path.join(self.cache_dir, rel_path)
809230
def initialize_copy(other)
      @steps = other.steps.map do |step|
        step.class.new(self, *step.args)
      end
      @content = other.content.dup
      @url_attributes = other.url_attributes.dup
    end
30129
def copy(self, path, dest, raise_if_exists=False):
        
        if raise_if_exists and dest in self.get_all_data():
            raise RuntimeError('Destination exists: %s' % path)
        contents = self.get_all_data()[path]
        self.get_all_data()[dest] = contents
495992
def _copy_across(self, rel_path, cb=None):
        """"""

        from . import copy_file_or_flo

        if not self.upstream.has(rel_path):

            if not self.alternate.has(rel_path):

                return None

            source = self.alternate.get_stream(rel_path)

            sink = self.upstream.put_stream(rel_path, metadata=source.meta)

            try:
                copy_file_or_flo(source, sink, cb=cb)
            except:
                self.upstream.remove(rel_path, propagate=True)
                raise

            source.close()
            sink.close()
904561
def copy_file(self, path, prefixed_path, source_storage):
        
        args = (path, prefixed_path, source_storage)
        if settings.threads:
            self.tasks.append(args)
        else:
            self.do_copy_file(args)
288751
public Response copy(Session destSession, String sourcePath, String destPath)
   {
      try
      {
         Workspace workspace = destSession.getWorkspace();
         workspace.copy(sourcePath, destPath);

         // If the source resource was successfully moved
         // to a pre-existing destination resource.
         if (itemExisted)
         {
            return Response.noContent().build();
         }
         // If the source resource was successfully moved,
         // and a new resource was created at the destination.
         else
         {
            if (uriBuilder != null)
            {
               return Response.created(uriBuilder.path(workspace.getName()).path(destPath).build()).build();
            }

            // to save compatibility if uribuilder is not provided
            return Response.status(HTTPStatus.CREATED).build();
         }

      }
      catch (ItemExistsException e)
      {
         return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).entity(e.getMessage()).build();
      }
      catch (PathNotFoundException e)
      {
         return Response.status(HTTPStatus.CONFLICT).entity(e.getMessage()).build();
      }
      catch (AccessDeniedException e)
      {
         return Response.status(HTTPStatus.FORBIDDEN).entity(e.getMessage()).build();
      }
      catch (LockException e)
      {
         return Response.status(HTTPStatus.LOCKED).entity(e.getMessage()).build();
      }
      catch (RepositoryException e)
      {
         log.error(e.getMessage(), e);
         return Response.serverError().entity(e.getMessage()).build();
      }
   }