Zotero.File.copyToUnique() (unused)
This commit is contained in:
parent
32cda9a696
commit
5c5addceee
|
@ -27,6 +27,7 @@ Zotero.File = new function(){
|
|||
this.getContents = getContents;
|
||||
this.getContentsFromURL = getContentsFromURL;
|
||||
this.putContents = putContents;
|
||||
this.copyToUnique = this.copyToUnique;
|
||||
this.getCharsetFromFile = getCharsetFromFile;
|
||||
this.addCharsetListener = addCharsetListener;
|
||||
|
||||
|
@ -147,6 +148,17 @@ Zotero.File = new function(){
|
|||
}
|
||||
|
||||
|
||||
function copyToUnique(file, newFile) {
|
||||
newFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0644);
|
||||
var newName = newFile.leafName;
|
||||
newFile.remove(null);
|
||||
|
||||
// Copy file to unique name
|
||||
file.copyTo(newFile.parent, newName);
|
||||
return file;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Not implemented, but it'd sure be great if it were
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user