[update] Ignore file on size or mime type

This commit is contained in:
brunosimon
2016-09-17 23:10:36 +02:00
parent 2cc95d0160
commit ae800cc01f
9 changed files with 100 additions and 76 deletions
+20 -17
View File
@@ -46,6 +46,26 @@ class Files
return file
}
create_version( _path, _content )
{
// Set up
let normalized_path = paths.normalize( _path )
// Retrieve file
let file = this.get( normalized_path, true )
if( _content )
{
// Create version
file.create_version( _content )
}
// Save
this.last_version_date = new Date()
return file
}
get( _path, _force_creation )
{
// Params
@@ -75,23 +95,6 @@ class Files
return false
}
create_version( _path, _content )
{
// Set up
let normalized_path = paths.normalize( _path )
// Retrieve file
let file = this.get( normalized_path, true )
// Create version
file.create_version( _content )
// Save
this.last_version_date = new Date()
return file
}
delete( _path )
{
// Set up