Class: GDSync::FileSystem::AbstractFile

Inherits:
Object
  • Object
show all
Defined in:
lib/file_system.rb

Instance Method Summary collapse

Instance Method Details

#birthtimeDateTime

Created time

Returns:

  • (DateTime)

41
42
43
# File 'lib/file_system.rb', line 41

def birthtime
  raise 'abstract method "birthtime" called'
end

#copy_to(dest_dir, birthtime, mtime) ⇒ AbstractFile

Copy file to 'dest_dir'. self and dest_dir must be same filesystem.

Parameters:

  • dest_dir (AbstractDir)
  • birthtime (DateTime)
  • mtime (DateTime)

Returns:

  • (AbstractFile)

    AbstractFile object pointing to copied file.


84
85
86
# File 'lib/file_system.rb', line 84

def copy_to(dest_dir, birthtime, mtime)
  raise 'abstract method "copy_to" called'
end

#create_read_ioIO

Creates IO object to read the file.

Returns:

  • (IO)

Raises:

  • NotSupportedError when 'create_read_io' operation is not supported by the filesystem.


60
61
62
# File 'lib/file_system.rb', line 60

def create_read_io
  raise 'abstract method "create_read_io" called'
end

#delete!Object

Delete file.


89
90
91
# File 'lib/file_system.rb', line 89

def delete!
  raise 'abstract method "delete!" called'
end

#fsFileSystem

A FileSystem object which manages this AbstractFile object.

Returns:


53
54
55
# File 'lib/file_system.rb', line 53

def fs
  raise 'abstract method "fs" called'
end

#is_dir?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'lib/file_system.rb', line 23

def is_dir?
  false
end

#md5String

MD5 checksum.

Returns:

  • (String)

47
48
49
# File 'lib/file_system.rb', line 47

def md5
  raise 'abstract method "md5" called'
end

#mtimeDateTime

Last modified time.

Returns:

  • (DateTime)

35
36
37
# File 'lib/file_system.rb', line 35

def mtime
  raise 'abstract method "mtime" called'
end

#pathString

Path string (ex. “googledrive://Some/Directory/sample.txt”)

Returns:

  • (String)

19
20
21
# File 'lib/file_system.rb', line 19

def path
  raise 'abstract method "path" called'
end

#sizeInteger

File size in bytes.

Returns:

  • (Integer)

29
30
31
# File 'lib/file_system.rb', line 29

def size
  raise 'abstract method "size" called'
end

#titleString

Returns file name.

Returns:

  • (String)

13
14
15
# File 'lib/file_system.rb', line 13

def title
  raise 'abstract method "title" called'
end

#update!(read_io, mtime) ⇒ AbstractFile

Read from @a read_io and write to this file.

Parameters:

  • read_io (IO)
  • mtime (DateTime)

    New last modified datetime of this file.

Returns:


74
75
76
# File 'lib/file_system.rb', line 74

def update!(read_io, mtime)
  raise 'abstract method "update!" called'
end

#write_to(write_io) ⇒ Object

Read this file and write to 'write_io' IO object.

Parameters:

  • write_io (IO)

66
67
68
# File 'lib/file_system.rb', line 66

def write_to(write_io)
  raise 'abstract method "write_to" called'
end