fcfinder-en 1.0.0.en
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README-tr.md +356 -0
- data/README.md +362 -0
- data/Rakefile +1 -0
- data/app/assets/images/fcfinder/about.png +0 -0
- data/app/assets/images/fcfinder/copy.png +0 -0
- data/app/assets/images/fcfinder/cut.png +0 -0
- data/app/assets/images/fcfinder/date_sorter.png +0 -0
- data/app/assets/images/fcfinder/delete.png +0 -0
- data/app/assets/images/fcfinder/directory-max.png +0 -0
- data/app/assets/images/fcfinder/directory.png +0 -0
- data/app/assets/images/fcfinder/directory_mini.png +0 -0
- data/app/assets/images/fcfinder/download.png +0 -0
- data/app/assets/images/fcfinder/duplicate.png +0 -0
- data/app/assets/images/fcfinder/edit.png +0 -0
- data/app/assets/images/fcfinder/files/7z.png +0 -0
- data/app/assets/images/fcfinder/files/Untitled-24.png +0 -0
- data/app/assets/images/fcfinder/files/avi.png +0 -0
- data/app/assets/images/fcfinder/files/bmp.png +0 -0
- data/app/assets/images/fcfinder/files/bz.png +0 -0
- data/app/assets/images/fcfinder/files/bz2.png +0 -0
- data/app/assets/images/fcfinder/files/css.png +0 -0
- data/app/assets/images/fcfinder/files/doc.png +0 -0
- data/app/assets/images/fcfinder/files/docx.png +0 -0
- data/app/assets/images/fcfinder/files/dv.png +0 -0
- data/app/assets/images/fcfinder/files/flv.png +0 -0
- data/app/assets/images/fcfinder/files/gif.png +0 -0
- data/app/assets/images/fcfinder/files/gz.png +0 -0
- data/app/assets/images/fcfinder/files/htm.png +0 -0
- data/app/assets/images/fcfinder/files/html.png +0 -0
- data/app/assets/images/fcfinder/files/ico.png +0 -0
- data/app/assets/images/fcfinder/files/jpeg.png +0 -0
- data/app/assets/images/fcfinder/files/jpg.png +0 -0
- data/app/assets/images/fcfinder/files/js.png +0 -0
- data/app/assets/images/fcfinder/files/mid.png +0 -0
- data/app/assets/images/fcfinder/files/mkv.png +0 -0
- data/app/assets/images/fcfinder/files/mov.png +0 -0
- data/app/assets/images/fcfinder/files/mp3.png +0 -0
- data/app/assets/images/fcfinder/files/mp4.png +0 -0
- data/app/assets/images/fcfinder/files/mp4a.png +0 -0
- data/app/assets/images/fcfinder/files/mpg.png +0 -0
- data/app/assets/images/fcfinder/files/ogg.png +0 -0
- data/app/assets/images/fcfinder/files/other.png +0 -0
- data/app/assets/images/fcfinder/files/pdf.png +0 -0
- data/app/assets/images/fcfinder/files/php.png +0 -0
- data/app/assets/images/fcfinder/files/png.png +0 -0
- data/app/assets/images/fcfinder/files/pps.png +0 -0
- data/app/assets/images/fcfinder/files/ppt.png +0 -0
- data/app/assets/images/fcfinder/files/pptx.png +0 -0
- data/app/assets/images/fcfinder/files/psd.png +0 -0
- data/app/assets/images/fcfinder/files/rar.png +0 -0
- data/app/assets/images/fcfinder/files/rb.png +0 -0
- data/app/assets/images/fcfinder/files/swf.png +0 -0
- data/app/assets/images/fcfinder/files/tar.png +0 -0
- data/app/assets/images/fcfinder/files/tbz.png +0 -0
- data/app/assets/images/fcfinder/files/tga.png +0 -0
- data/app/assets/images/fcfinder/files/tgz.png +0 -0
- data/app/assets/images/fcfinder/files/tif.png +0 -0
- data/app/assets/images/fcfinder/files/tiff.png +0 -0
- data/app/assets/images/fcfinder/files/txt.png +0 -0
- data/app/assets/images/fcfinder/files/wav.png +0 -0
- data/app/assets/images/fcfinder/files/wm.png +0 -0
- data/app/assets/images/fcfinder/files/wma.png +0 -0
- data/app/assets/images/fcfinder/files/xls.png +0 -0
- data/app/assets/images/fcfinder/files/xlsx.png +0 -0
- data/app/assets/images/fcfinder/files/xml.png +0 -0
- data/app/assets/images/fcfinder/files/zip.png +0 -0
- data/app/assets/images/fcfinder/finder.png +0 -0
- data/app/assets/images/fcfinder/icon_view.png +0 -0
- data/app/assets/images/fcfinder/info.png +0 -0
- data/app/assets/images/fcfinder/info2.png +0 -0
- data/app/assets/images/fcfinder/kind_sorter.png +0 -0
- data/app/assets/images/fcfinder/list_view.png +0 -0
- data/app/assets/images/fcfinder/name_sorter.png +0 -0
- data/app/assets/images/fcfinder/new_folder.png +0 -0
- data/app/assets/images/fcfinder/paste.png +0 -0
- data/app/assets/images/fcfinder/preview.png +0 -0
- data/app/assets/images/fcfinder/refresh.png +0 -0
- data/app/assets/images/fcfinder/rename.png +0 -0
- data/app/assets/images/fcfinder/settings.png +0 -0
- data/app/assets/images/fcfinder/show_date.png +0 -0
- data/app/assets/images/fcfinder/show_size.png +0 -0
- data/app/assets/images/fcfinder/size_sorter.png +0 -0
- data/app/assets/images/fcfinder/sort.png +0 -0
- data/app/assets/images/fcfinder/tree/folder.png +0 -0
- data/app/assets/images/fcfinder/tree/loader.gif +0 -0
- data/app/assets/images/fcfinder/tree/minus.png +0 -0
- data/app/assets/images/fcfinder/tree/plus.png +0 -0
- data/app/assets/images/fcfinder/up_folder.png +0 -0
- data/app/assets/images/fcfinder/upload.png +0 -0
- data/app/assets/javascripts/fcfinder.js +1697 -0
- data/app/assets/stylesheets/fcfinder.css +347 -0
- data/app/assets/stylesheets/fcfinder.css.scss +347 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/fcfinder-0.1.0.gem +0 -0
- data/fcfinder-0.1.1.gem +0 -0
- data/fcfinder.gemspec +31 -0
- data/lib/fcfinder/connector.rb +612 -0
- data/lib/fcfinder/engine.rb +12 -0
- data/lib/fcfinder/version.rb +3 -0
- data/lib/fcfinder/zip_file_generator.rb +47 -0
- data/lib/fcfinder.rb +7 -0
- data/screenshots/fcfinder_interface.png +0 -0
- data/vendor/assets/images/fcfinder/about.png +0 -0
- data/vendor/assets/images/fcfinder/copy.png +0 -0
- data/vendor/assets/images/fcfinder/cut.png +0 -0
- data/vendor/assets/images/fcfinder/date_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/delete.png +0 -0
- data/vendor/assets/images/fcfinder/directory-max.png +0 -0
- data/vendor/assets/images/fcfinder/directory.png +0 -0
- data/vendor/assets/images/fcfinder/directory_mini.png +0 -0
- data/vendor/assets/images/fcfinder/download.png +0 -0
- data/vendor/assets/images/fcfinder/duplicate.png +0 -0
- data/vendor/assets/images/fcfinder/edit.png +0 -0
- data/vendor/assets/images/fcfinder/files/7z.png +0 -0
- data/vendor/assets/images/fcfinder/files/Untitled-24.png +0 -0
- data/vendor/assets/images/fcfinder/files/avi.png +0 -0
- data/vendor/assets/images/fcfinder/files/bmp.png +0 -0
- data/vendor/assets/images/fcfinder/files/bz.png +0 -0
- data/vendor/assets/images/fcfinder/files/bz2.png +0 -0
- data/vendor/assets/images/fcfinder/files/css.png +0 -0
- data/vendor/assets/images/fcfinder/files/doc.png +0 -0
- data/vendor/assets/images/fcfinder/files/docx.png +0 -0
- data/vendor/assets/images/fcfinder/files/dv.png +0 -0
- data/vendor/assets/images/fcfinder/files/flv.png +0 -0
- data/vendor/assets/images/fcfinder/files/gif.png +0 -0
- data/vendor/assets/images/fcfinder/files/gz.png +0 -0
- data/vendor/assets/images/fcfinder/files/htm.png +0 -0
- data/vendor/assets/images/fcfinder/files/html.png +0 -0
- data/vendor/assets/images/fcfinder/files/ico.png +0 -0
- data/vendor/assets/images/fcfinder/files/jpeg.png +0 -0
- data/vendor/assets/images/fcfinder/files/jpg.png +0 -0
- data/vendor/assets/images/fcfinder/files/js.png +0 -0
- data/vendor/assets/images/fcfinder/files/mid.png +0 -0
- data/vendor/assets/images/fcfinder/files/mkv.png +0 -0
- data/vendor/assets/images/fcfinder/files/mov.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp3.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp4.png +0 -0
- data/vendor/assets/images/fcfinder/files/mp4a.png +0 -0
- data/vendor/assets/images/fcfinder/files/mpg.png +0 -0
- data/vendor/assets/images/fcfinder/files/ogg.png +0 -0
- data/vendor/assets/images/fcfinder/files/other.png +0 -0
- data/vendor/assets/images/fcfinder/files/pdf.png +0 -0
- data/vendor/assets/images/fcfinder/files/php.png +0 -0
- data/vendor/assets/images/fcfinder/files/png.png +0 -0
- data/vendor/assets/images/fcfinder/files/pps.png +0 -0
- data/vendor/assets/images/fcfinder/files/ppt.png +0 -0
- data/vendor/assets/images/fcfinder/files/pptx.png +0 -0
- data/vendor/assets/images/fcfinder/files/psd.png +0 -0
- data/vendor/assets/images/fcfinder/files/rar.png +0 -0
- data/vendor/assets/images/fcfinder/files/rb.png +0 -0
- data/vendor/assets/images/fcfinder/files/swf.png +0 -0
- data/vendor/assets/images/fcfinder/files/tar.png +0 -0
- data/vendor/assets/images/fcfinder/files/tbz.png +0 -0
- data/vendor/assets/images/fcfinder/files/tga.png +0 -0
- data/vendor/assets/images/fcfinder/files/tgz.png +0 -0
- data/vendor/assets/images/fcfinder/files/tif.png +0 -0
- data/vendor/assets/images/fcfinder/files/tiff.png +0 -0
- data/vendor/assets/images/fcfinder/files/txt.png +0 -0
- data/vendor/assets/images/fcfinder/files/wav.png +0 -0
- data/vendor/assets/images/fcfinder/files/wm.png +0 -0
- data/vendor/assets/images/fcfinder/files/wma.png +0 -0
- data/vendor/assets/images/fcfinder/files/xls.png +0 -0
- data/vendor/assets/images/fcfinder/files/xlsx.png +0 -0
- data/vendor/assets/images/fcfinder/files/xml.png +0 -0
- data/vendor/assets/images/fcfinder/files/zip.png +0 -0
- data/vendor/assets/images/fcfinder/finder.png +0 -0
- data/vendor/assets/images/fcfinder/icon_view.png +0 -0
- data/vendor/assets/images/fcfinder/info.png +0 -0
- data/vendor/assets/images/fcfinder/info2.png +0 -0
- data/vendor/assets/images/fcfinder/kind_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/list_view.png +0 -0
- data/vendor/assets/images/fcfinder/name_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/new_folder.png +0 -0
- data/vendor/assets/images/fcfinder/paste.png +0 -0
- data/vendor/assets/images/fcfinder/preview.png +0 -0
- data/vendor/assets/images/fcfinder/refresh.png +0 -0
- data/vendor/assets/images/fcfinder/rename.png +0 -0
- data/vendor/assets/images/fcfinder/settings.png +0 -0
- data/vendor/assets/images/fcfinder/show_date.png +0 -0
- data/vendor/assets/images/fcfinder/show_size.png +0 -0
- data/vendor/assets/images/fcfinder/size_sorter.png +0 -0
- data/vendor/assets/images/fcfinder/sort.png +0 -0
- data/vendor/assets/images/fcfinder/tree/folder.png +0 -0
- data/vendor/assets/images/fcfinder/tree/loader.gif +0 -0
- data/vendor/assets/images/fcfinder/tree/minus.png +0 -0
- data/vendor/assets/images/fcfinder/tree/plus.png +0 -0
- data/vendor/assets/images/fcfinder/up_folder.png +0 -0
- data/vendor/assets/images/fcfinder/upload.png +0 -0
- data/vendor/assets/javascripts/fcfinder.js +1698 -0
- data/vendor/assets/stylesheets/fcfinder.css +347 -0
- data/vendor/assets/stylesheets/fcfinder.css.erb +347 -0
- metadata +300 -0
@@ -0,0 +1,612 @@
|
|
1
|
+
module Fcfinder
|
2
|
+
class Connector
|
3
|
+
attr_reader :run
|
4
|
+
|
5
|
+
def initialize(file,host_url,fc_params=nil,options = {})
|
6
|
+
|
7
|
+
#Max dosya boyutu boş ise 1MB dosya yüklemesine izin ver
|
8
|
+
@max_file_size = options[:max_file_size] ||= 1_000_000
|
9
|
+
@allowed_mime = options[:allowed_mime] ||= {}
|
10
|
+
@disallowed_mime = options[:disallowed_mime] ||= {}
|
11
|
+
#izin verilen dosyalar
|
12
|
+
@permission_mime = permission_mime(@allowed_mime,@disallowed_mime)
|
13
|
+
|
14
|
+
@file = file
|
15
|
+
@fcdir = file.chomp('/*')
|
16
|
+
@main_folder = @fcdir.split('/').last
|
17
|
+
@host_url = host_url
|
18
|
+
@main_file = {}
|
19
|
+
|
20
|
+
|
21
|
+
if fc_params.nil?
|
22
|
+
@main_params = append_file(file)
|
23
|
+
@main_params[:main_file] = {:path => file.split('/')[-2], :url => file, :sub_dir => @main_file[:sub_dir]}
|
24
|
+
result = [@main_params, @main_params[:directory].size+@main_params[:file].size, format_mb(directory_size(@main_params[:main_file][:url].chomp('/*')))]
|
25
|
+
else
|
26
|
+
result = case fc_params[:type]
|
27
|
+
when 'path_to_url'
|
28
|
+
path_to_url(get_path(fc_params[:path]))
|
29
|
+
|
30
|
+
#Tum Dosyaları Listele
|
31
|
+
#Klasor Secilme İslemi Yapilinca
|
32
|
+
when 'all_file_list'
|
33
|
+
all_file_list(get_path(fc_params[:url]))
|
34
|
+
|
35
|
+
#Yeni Klasor Olusturma
|
36
|
+
when 'create_directory'
|
37
|
+
create_directory(fc_params[:path], fc_params[:directory_name])
|
38
|
+
|
39
|
+
#Yenileme Islemi
|
40
|
+
when 'refresh'
|
41
|
+
refresh(get_path(fc_params[:path]))
|
42
|
+
|
43
|
+
#Dosya Indirme Islemi
|
44
|
+
when 'download'
|
45
|
+
download(get_path(fc_params[:path]))
|
46
|
+
|
47
|
+
#Bilgiler
|
48
|
+
when 'info'
|
49
|
+
info_and_preview(fc_params[:file], fc_params[:kind])
|
50
|
+
|
51
|
+
#Onizleme
|
52
|
+
when 'preview'
|
53
|
+
info_and_preview(fc_params[:file], fc_params[:kind])
|
54
|
+
|
55
|
+
#Dosya Kopyala
|
56
|
+
when 'copy'
|
57
|
+
copy(get_path(fc_params[:copy_file_path]), get_path(fc_params[:this_folder_path]))
|
58
|
+
|
59
|
+
#Dosya Zorunlu Kopyala
|
60
|
+
when 'copy!'
|
61
|
+
copy!(get_path(fc_params[:copy_file_path]), get_path(fc_params[:this_folder_path]))
|
62
|
+
|
63
|
+
#Dosya Kesme
|
64
|
+
when 'cut'
|
65
|
+
cut(get_path(fc_params[:cut_file_path]), get_path(fc_params[:this_folder_path]))
|
66
|
+
|
67
|
+
#Dosyayı Zorla Kes
|
68
|
+
when 'cut!'
|
69
|
+
cut!(get_path(fc_params[:cut_file_path]), get_path(fc_params[:this_folder_path]))
|
70
|
+
|
71
|
+
#Dosya Kopyasını Oluşturma
|
72
|
+
when 'duplicate'
|
73
|
+
duplicate(get_path(fc_params[:file_path]))
|
74
|
+
|
75
|
+
#Dosya Yeniden Adlandır
|
76
|
+
when 'file_rename'
|
77
|
+
file_rename(get_path(fc_params[:path]), fc_params[:file_name])
|
78
|
+
|
79
|
+
#Dosya Silme İşlemi
|
80
|
+
when 'delete'
|
81
|
+
delete!(get_path(fc_params[:file_path]))
|
82
|
+
|
83
|
+
#Dosya Yükleme İşlemi
|
84
|
+
when 'upload'
|
85
|
+
upload(fc_params[:upload], get_path(fc_params[:path]))
|
86
|
+
|
87
|
+
#Dosya Duzenleme
|
88
|
+
when 'edit_file'
|
89
|
+
edit_file(get_path(fc_params[:file_path]))
|
90
|
+
else
|
91
|
+
# type code here
|
92
|
+
end
|
93
|
+
end
|
94
|
+
@run = result.to_json
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
def path_to_url(path)
|
99
|
+
if File.exist?(path)
|
100
|
+
['true',get_url(set_path(path))]
|
101
|
+
else
|
102
|
+
%w(false 0)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
def all_file_list(url)
|
108
|
+
@url_params = append_file(url+'/*')
|
109
|
+
[@url_params,@url_params[:directory].size+@url_params[:file].size,format_mb(directory_size(url))]
|
110
|
+
end
|
111
|
+
|
112
|
+
def create_directory(path,directory_name)
|
113
|
+
create_file_path = File.join(get_path(path),directory_name)
|
114
|
+
create_file_thumbs = create_file_path.sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs')
|
115
|
+
if File.exist?(create_file_path)
|
116
|
+
#-1 => Aynı İsimde Dosya Var Dosya Oluşmadı
|
117
|
+
%w(false -1)
|
118
|
+
else
|
119
|
+
if Dir.mkdir(create_file_path) && Dir.mkdir(create_file_thumbs)
|
120
|
+
['true', {:top_dir => path, :path => set_path(create_file_path)}]
|
121
|
+
else
|
122
|
+
#0 => Herhangibir Hata var Dosya Oluşmadı
|
123
|
+
%w(false 0)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def refresh(path)
|
129
|
+
append_file(File.join(path,'/*'))
|
130
|
+
end
|
131
|
+
|
132
|
+
def add_zip_file(path, output_file)
|
133
|
+
zf = ZipFileGenerator.new(path, output_file)
|
134
|
+
zf.write
|
135
|
+
end
|
136
|
+
|
137
|
+
def download(path)
|
138
|
+
begin
|
139
|
+
if File.directory?(path)
|
140
|
+
output_file = path.chomp('/')+'.zip'
|
141
|
+
add_zip_file(path, output_file)
|
142
|
+
file = set_path(output_file).sub('fcdir:/', '').split('/').join(':')
|
143
|
+
type = path.chomp('/')+'.zip'
|
144
|
+
else
|
145
|
+
file = set_path(path).sub('fcdir:/', '').split('/').join(':')
|
146
|
+
type = path
|
147
|
+
end
|
148
|
+
result = { :file => file, :type => MIME::Types.type_for(type).first.content_type }
|
149
|
+
rescue Exception => e
|
150
|
+
result = ['false', '0',e.to_s]
|
151
|
+
end
|
152
|
+
result
|
153
|
+
end
|
154
|
+
|
155
|
+
def info_and_preview(file,kind)
|
156
|
+
{ :url => get_url(file),
|
157
|
+
:path => file,
|
158
|
+
:size => kind=='directory' ? format_mb(directory_size(get_path(file))) : format_mb(File.size(get_path(file))),
|
159
|
+
:ctime => File.ctime(get_path(file)).strftime('%d/%m/%Y %H:%M'),
|
160
|
+
:mtime => File.mtime(get_path(file)).strftime('%d/%m/%Y %H:%M'),
|
161
|
+
:type => File.directory?(get_path(file)) ? 'directory' : set_type(MIME::Types.type_for(get_path(file)).first.content_type) ,
|
162
|
+
:mime_type => File.directory?(get_path(file)) ? 'directory' : MIME::Types.type_for(get_path(file)).first.content_type ,
|
163
|
+
:permissions => {:write => File.writable?(get_path(file)).to_s, :read => File.readable?(get_path(file)).to_s}
|
164
|
+
}
|
165
|
+
end
|
166
|
+
|
167
|
+
def thumbs(opt)
|
168
|
+
thumbs = ''
|
169
|
+
thumbs = opt[:target].sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs') if opt[:type] == :cut || opt[:type] == :copy || opt[:type] == :rename
|
170
|
+
thumbs = opt[:file_path].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs') if opt[:type] == :duplicate || opt[:type] == :duplicate2
|
171
|
+
if File.directory?(opt[:file])
|
172
|
+
FileUtils.cp_r(opt[:file].sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs'),thumbs) if opt[:type ] == :copy
|
173
|
+
FileUtils.mv(opt[:file].sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs'),thumbs) if opt[:type ] == :cut
|
174
|
+
FileUtils.cp_r(thumbs, opt[:folder_name].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs')+'/'+opt[:file_name]+' copy 1'+opt[:extension]) if opt[:type ] == :duplicate
|
175
|
+
FileUtils.cp_r(thumbs, opt[:new_file_path].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs')) if opt[:type2] == :duplicate2
|
176
|
+
FileUtils.mv(thumbs, File.join(opt[:folder_name].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs'),opt[:file_name])) if opt[:type] == :rename
|
177
|
+
else
|
178
|
+
if %w(image/x-ms-bmp image/jpeg image/gif image/png).include?(MIME::Types.type_for(opt[:file]).first.content_type)
|
179
|
+
unless File.exist?(thumbs)
|
180
|
+
_folder = ''
|
181
|
+
thumbs.split('/').each do |folder|
|
182
|
+
_folder << folder+'/'
|
183
|
+
unless File.exist?(_folder)
|
184
|
+
Dir.mkdir(_folder.chomp('/'))
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
FileUtils.cp_r(opt[:file].sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs'),thumbs) if opt[:type] == :copy
|
189
|
+
FileUtils.mv(opt[:file].sub(@fcdir.chomp('/'),@fcdir.chomp('/')+'/.thumbs'),thumbs) if opt[:type] == :cut
|
190
|
+
FileUtils.cp_r(thumbs, opt[:folder_name].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs')+'/'+opt[:file_name]+' copy 1'+opt[:extension]) if opt[:type] == :duplicate
|
191
|
+
FileUtils.cp_r(thumbs, opt[:new_file_path].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs')) if opt[:type] == :duplicate2
|
192
|
+
FileUtils.mv(thumbs, File.join(opt[:folder_name].sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs'),opt[:file_name])) if opt[:type] == :rename
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
def image_resize(file_path)
|
198
|
+
file_path.each do |file|
|
199
|
+
#ORJ=>thumbs = file.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs').chomp(file.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs').split('/').last).chomp('/')
|
200
|
+
thumbs = file.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs').chomp(file.split('/').last).chomp('/')
|
201
|
+
unless File.exist?(thumbs)
|
202
|
+
_folder = ''
|
203
|
+
thumbs.split('/').each do |folder|
|
204
|
+
_folder << folder + '/'
|
205
|
+
unless File.exist?(_folder)
|
206
|
+
Dir.mkdir(_folder.chomp('/'))
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
image = MiniMagick::Image.open(file)
|
211
|
+
image.resize '64x64'
|
212
|
+
image.write(file.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs'))
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
def copy(file,target)
|
217
|
+
begin
|
218
|
+
file_path = File.join(target,file.split('/').last)
|
219
|
+
if File.exist?(file_path)
|
220
|
+
#0 => Aynı Dosyadan Var
|
221
|
+
result = %w(false 0)
|
222
|
+
else
|
223
|
+
#Kopyalama İşlemini Gerçekleştir
|
224
|
+
FileUtils.cp_r(file,target)
|
225
|
+
thumbs({:file=>file, :target=>target, :type=>:copy})
|
226
|
+
result = %w(true)
|
227
|
+
end
|
228
|
+
rescue Exception => e
|
229
|
+
result = ['false', '-1',e.to_s]
|
230
|
+
end
|
231
|
+
result
|
232
|
+
end
|
233
|
+
|
234
|
+
def copy!(file,target)
|
235
|
+
begin
|
236
|
+
#Kopyalama İşlemini Gerçekleştir
|
237
|
+
FileUtils.cp_r(file,target)
|
238
|
+
|
239
|
+
#thumbs'a kopyasını gönder
|
240
|
+
thumbs({:file=>file, :target=>target, :type=>:copy})
|
241
|
+
result = %w(true)
|
242
|
+
rescue Exception => e
|
243
|
+
result = ['false', '-1',e.to_s]
|
244
|
+
end
|
245
|
+
result
|
246
|
+
end
|
247
|
+
|
248
|
+
def cut(file,target)
|
249
|
+
begin
|
250
|
+
file_path = target.chomp('/')+'/'+file.split('/').last
|
251
|
+
if File.exist?(file_path) || File.directory?(file_path)
|
252
|
+
#0 => Aynı Dosyadan Var
|
253
|
+
result = %w(false 0)
|
254
|
+
else
|
255
|
+
#Kesme İşlemini Gerçekleştir
|
256
|
+
FileUtils.mv(file,target)
|
257
|
+
#thumbs'a kopyasını gönder
|
258
|
+
thumbs({:file=>file, :target=>target, :type=>:cut})
|
259
|
+
result = %w(true)
|
260
|
+
end
|
261
|
+
rescue Exception => e
|
262
|
+
result = ['false', '-1',e.to_s]
|
263
|
+
end
|
264
|
+
result
|
265
|
+
end
|
266
|
+
|
267
|
+
def cut!(file,target)
|
268
|
+
begin
|
269
|
+
#Kesme İşlemini Gerçekleştir
|
270
|
+
FileUtils.mv(file,target)
|
271
|
+
#thumbs'a kopyasını gönder
|
272
|
+
thumbs({:file=>file, :target=>target, :type=>:cut})
|
273
|
+
result = %w(true)
|
274
|
+
rescue Exception => e
|
275
|
+
result = ['false', '-1',e.to_s]
|
276
|
+
end
|
277
|
+
result
|
278
|
+
end
|
279
|
+
|
280
|
+
def duplicate(file)
|
281
|
+
begin
|
282
|
+
file_path = file.chomp('/')
|
283
|
+
extension = (file_path.split('/').last.split('.').size>1) ? '.'+file_path.split('/').last.split('.').last : ''
|
284
|
+
file_name = file_path.split('/').last.chomp(extension)
|
285
|
+
folder_name = file_path.chomp(file_path.split('/').last).chomp('/')
|
286
|
+
|
287
|
+
reg_file = "#{file_name}".match(/(.+?) copy ([0-9])/i)
|
288
|
+
if reg_file.nil? && !File.exist?(folder_name+'/'+file_name+' copy 1'+extension)
|
289
|
+
FileUtils.cp_r(file_path, folder_name+'/'+file_name+' copy 1'+extension)
|
290
|
+
#thumbs dosyaları ekle
|
291
|
+
thumbs({:file_path=>file_path,:file=>file_path,:type=>:duplicate,:folder_name=>folder_name,:file_name=>file_name,:extension=>extension})
|
292
|
+
result = %w(true)
|
293
|
+
else
|
294
|
+
#"file_name copy 1" şeklinde bir dosya adı var
|
295
|
+
reg_file = "#{file_name} copy 1#{extension}".match(/(.+?) copy ([0-9])/i) if reg_file.nil?
|
296
|
+
j = Dir.glob("#{folder_name}/#{reg_file[1]} copy *#{extension}").last.match(/#{reg_file[1]} copy ([0-9])#{extension}/)[1].to_i + 1
|
297
|
+
|
298
|
+
new_file_name = "#{reg_file[1]} copy #{j}#{extension}"
|
299
|
+
new_file_path = folder_name.chomp('/')+'/'+new_file_name
|
300
|
+
FileUtils.cp_r(file_path, new_file_path)
|
301
|
+
#thumbs'a kopyasını gönder
|
302
|
+
thumbs({:file_path=>file_path,:file=>file_path,:type=>:duplicate2,:new_file_path=>new_file_path})
|
303
|
+
result = %w(true)
|
304
|
+
end
|
305
|
+
rescue Exception => e
|
306
|
+
result = ['false', '-1',e.to_s]
|
307
|
+
end
|
308
|
+
result
|
309
|
+
end
|
310
|
+
|
311
|
+
def file_rename(path,file_name)
|
312
|
+
begin
|
313
|
+
if File.exist?(path)
|
314
|
+
folder_name = path.chomp(path.split('/').last).chomp('/')
|
315
|
+
FileUtils.mv(path,folder_name+'/'+file_name)
|
316
|
+
#thumbs'a kopyasını gönder
|
317
|
+
thumbs({:file=>path,:target=>path,:type=>:rename,:folder_name=>folder_name,:file_name=>file_name})
|
318
|
+
result = %w(true)
|
319
|
+
else
|
320
|
+
#return false Dosya Yok!
|
321
|
+
result = %w(false)
|
322
|
+
end
|
323
|
+
rescue Exception => e
|
324
|
+
result = ['false', '-1',e.to_s]
|
325
|
+
end
|
326
|
+
result
|
327
|
+
end
|
328
|
+
|
329
|
+
def delete!(path)
|
330
|
+
begin
|
331
|
+
if File.exist?(path)
|
332
|
+
FileUtils.rm_rf(path)
|
333
|
+
FileUtils.rm_rf(path.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs')) if File.exist?(path.sub(@fcdir.chomp('/'), @fcdir.chomp('/')+'/.thumbs'))
|
334
|
+
result = %w(true)
|
335
|
+
else
|
336
|
+
#return false Dosya Yok!
|
337
|
+
result = %w(false 0)
|
338
|
+
end
|
339
|
+
rescue Exception => e
|
340
|
+
result = ['false', '-1',e.to_s]
|
341
|
+
end
|
342
|
+
result
|
343
|
+
end
|
344
|
+
|
345
|
+
def upload(upload_files,path)
|
346
|
+
begin
|
347
|
+
image_mime_type = %w(image/x-ms-bmp image/jpeg image/gif image/png)
|
348
|
+
file_path,error_delete_file = [],[]
|
349
|
+
upload_files.each do |file|
|
350
|
+
#dosya büyük
|
351
|
+
return ['false', '0',format_mb(@max_file_size)] if file.tempfile.size > @max_file_size
|
352
|
+
#format yok
|
353
|
+
return ['false', '-1',@permission_mime.to_a] unless @permission_mime.has_key?(file.original_filename.split('.').last) || @permission_mime[file.original_filename.split('.').last]==file.content_type
|
354
|
+
file_path.push(File.join(path,file.original_filename)) if image_mime_type.include?(file.content_type)
|
355
|
+
error_delete_file.push(File.join(path,file.original_filename))
|
356
|
+
File.open(File.join(path,file.original_filename), 'wb') do |f|
|
357
|
+
f.write(file.read)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# resimleri yeniden boyutlandır
|
362
|
+
image_resize(file_path)
|
363
|
+
result = %w(true)
|
364
|
+
rescue Exception => e
|
365
|
+
error_delete_file.each do |file|
|
366
|
+
FileUtils.rm_rf(file) unless File.size(file) > 0
|
367
|
+
end
|
368
|
+
result = ['false', '-2',e.to_s]
|
369
|
+
end
|
370
|
+
result
|
371
|
+
end
|
372
|
+
|
373
|
+
def edit_file(path)
|
374
|
+
File.exist?(path) ?
|
375
|
+
{ :url => get_url(set_path(path)), :title => path.chomp('/').split('/').last } :
|
376
|
+
%w(false 0)
|
377
|
+
end
|
378
|
+
|
379
|
+
def append_file(files_url)
|
380
|
+
all_file,all_dir = {},{}
|
381
|
+
Dir.glob(files_url).each do |file|
|
382
|
+
if File.directory?(file)
|
383
|
+
@main_file[:sub_dir] = true if @main_file[:sub_dir].nil?
|
384
|
+
all_dir[file.split('/').last] = {:file=>file,:url => get_url(set_path(file)), :sub_dir => false, :size_2 => directory_size(file), :size => format_mb(directory_size(file)), :ctime => File.ctime(file).strftime('%d/%m/%Y %H:%M'), :path => set_path(file), :type => '_directory'}
|
385
|
+
Dir.glob(file+'/*').each do |sub_dir|
|
386
|
+
if File.directory?(sub_dir)
|
387
|
+
all_dir[file.split('/').last][:sub_dir] = true
|
388
|
+
end
|
389
|
+
end
|
390
|
+
else
|
391
|
+
all_file[file.split('/').last] = {:file=>file, :path => set_path(file), :url => get_url(set_path(file)), :type => set_type(MIME::Types.type_for(file).first.content_type), :size_2 => File.size(file), :size => format_mb(File.size(file)), :ctime => File.ctime(file).strftime('%d/%m/%Y %H:%M')}
|
392
|
+
end
|
393
|
+
end
|
394
|
+
{ :directory => all_dir, :file => all_file }
|
395
|
+
end
|
396
|
+
|
397
|
+
|
398
|
+
def set_path(path)
|
399
|
+
path.chomp('/').sub(@fcdir, 'fcdir:')
|
400
|
+
end
|
401
|
+
|
402
|
+
|
403
|
+
def get_path(path)
|
404
|
+
path.chomp('/').sub('fcdir:',@fcdir)
|
405
|
+
end
|
406
|
+
|
407
|
+
|
408
|
+
def set_url(path)
|
409
|
+
path.chomp('/').sub(File.join(@host_url,@main_folder)+@main_folder, 'fcdir:')
|
410
|
+
end
|
411
|
+
|
412
|
+
|
413
|
+
def get_url(path)
|
414
|
+
path.chomp('/').sub('fcdir:',File.join(@host_url,@main_folder))
|
415
|
+
end
|
416
|
+
|
417
|
+
|
418
|
+
def set_type(type)
|
419
|
+
case type
|
420
|
+
when 'application/vnd.ms-word'
|
421
|
+
'doc'
|
422
|
+
when 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
423
|
+
'docx'
|
424
|
+
when 'application/vnd.ms-excel'
|
425
|
+
'xls'
|
426
|
+
when 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
427
|
+
'xlsx'
|
428
|
+
when 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
|
429
|
+
'pptx'
|
430
|
+
when 'application/vnd.ms-powerpoint'
|
431
|
+
'ppt'
|
432
|
+
when 'application/pdf'
|
433
|
+
'pdf'
|
434
|
+
when 'application/xml'
|
435
|
+
'xml'
|
436
|
+
when 'application/x-shockwave-flash'
|
437
|
+
'swf'
|
438
|
+
when 'application/x-gzip', 'application/gzip'
|
439
|
+
'gz'
|
440
|
+
when 'application/x-gtar'
|
441
|
+
'tgz'
|
442
|
+
when 'application/x-bzip'
|
443
|
+
'bz'
|
444
|
+
when 'application/x-bzip2'
|
445
|
+
'bz2'
|
446
|
+
when 'application/zip'
|
447
|
+
'zip'
|
448
|
+
when 'application/x-rar', 'application/x-rar-compressed'
|
449
|
+
'rar'
|
450
|
+
when 'application/x-tar'
|
451
|
+
'tar'
|
452
|
+
when 'application/x-7z-compressed'
|
453
|
+
'7z'
|
454
|
+
when 'text/plain'
|
455
|
+
'txt'
|
456
|
+
when 'text/x-php', 'application/x-httpd-php'
|
457
|
+
'php'
|
458
|
+
when 'text/html'
|
459
|
+
'html'
|
460
|
+
when 'text/htm'
|
461
|
+
'htm'
|
462
|
+
when 'application/javascript'
|
463
|
+
'js'
|
464
|
+
when 'text/css'
|
465
|
+
'css'
|
466
|
+
when 'application/x-ruby'
|
467
|
+
'rb'
|
468
|
+
when 'image/tiff'
|
469
|
+
'tiff'
|
470
|
+
when 'image/x-targa'
|
471
|
+
'tga'
|
472
|
+
when 'image/vnd.adobe.photoshop'
|
473
|
+
'psd'
|
474
|
+
when 'image/x-icon'
|
475
|
+
'ico'
|
476
|
+
when 'audio/mpeg'
|
477
|
+
'mp3'
|
478
|
+
when 'audio/midi'
|
479
|
+
'mid'
|
480
|
+
when 'audio/ogg'
|
481
|
+
'ogg'
|
482
|
+
when 'audio/mp4'
|
483
|
+
'mp4a'
|
484
|
+
when 'audio/wav', 'audio/x-wav'
|
485
|
+
'wav'
|
486
|
+
when 'audio/x-ms-wma'
|
487
|
+
'vma'
|
488
|
+
when 'video/x-msvideo'
|
489
|
+
'avi'
|
490
|
+
when 'video/x-dv'
|
491
|
+
'dv'
|
492
|
+
when 'video/mp4'
|
493
|
+
'mp4'
|
494
|
+
when 'video/mpeg'
|
495
|
+
'mpeg'
|
496
|
+
when 'video/mpeg'
|
497
|
+
'mpg'
|
498
|
+
when 'video/quicktime'
|
499
|
+
'mov'
|
500
|
+
when 'video/x-ms-wmv'
|
501
|
+
'vm'
|
502
|
+
when 'video/x-flv'
|
503
|
+
'flv'
|
504
|
+
when 'video/x-matroska'
|
505
|
+
'mkv'
|
506
|
+
when 'image/png', 'image/jpeg','image/x-ms-bmp','image/gif'
|
507
|
+
'image_file'
|
508
|
+
else
|
509
|
+
'other'
|
510
|
+
end
|
511
|
+
end
|
512
|
+
|
513
|
+
|
514
|
+
def directory_size(path)
|
515
|
+
path << '/' unless path.end_with?('/')
|
516
|
+
raise RuntimeError, "#{path} is not a directory" unless File.directory?(path)
|
517
|
+
total_size = 0
|
518
|
+
Dir["#{path}**/*"].each do |f|
|
519
|
+
total_size += File.size(f) if File.file?(f) && File.size?(f)
|
520
|
+
end
|
521
|
+
total_size
|
522
|
+
end
|
523
|
+
|
524
|
+
|
525
|
+
def format_mb(size)
|
526
|
+
conv = %w(B KB MB GB TER PB EB)
|
527
|
+
scale = 1024
|
528
|
+
ndx=1
|
529
|
+
return "#{(size)} #{conv[ndx-1]}" if size < 2*(scale**ndx)
|
530
|
+
size=size.to_f
|
531
|
+
[2,3,4,5,6,7].each do |ndx|
|
532
|
+
return "#{'%.3f' % (size/(scale**(ndx-1)))} #{conv[ndx-1]}" if size < 2*(scale**ndx)
|
533
|
+
end
|
534
|
+
ndx=7
|
535
|
+
"#{'%.3f' % (size/(scale**(ndx-1)))} #{conv[ndx-1]}"
|
536
|
+
end
|
537
|
+
|
538
|
+
|
539
|
+
def permission_mime(allowed_mime,disallowed_mime)
|
540
|
+
permission = {
|
541
|
+
'doc' => 'application/vnd.ms-word',
|
542
|
+
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
543
|
+
'xls' => 'application/vnd.ms-excel',
|
544
|
+
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
545
|
+
'ppt' => 'application/vnd.ms-powerpoint',
|
546
|
+
'pps' => 'application/vnd.ms-powerpoint',
|
547
|
+
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
548
|
+
'pdf' => 'application/pdf',
|
549
|
+
'xml' => 'application/xml',
|
550
|
+
'swf' => 'application/x-shockwave-flash',
|
551
|
+
# archives
|
552
|
+
'gz' => 'application/x-gzip',
|
553
|
+
'tgz' => 'application/x-gzip',
|
554
|
+
'bz' => 'application/x-bzip2',
|
555
|
+
'bz2' => 'application/x-bzip2',
|
556
|
+
'tbz' => 'application/x-bzip2',
|
557
|
+
'zip' => 'application/zip',
|
558
|
+
'rar' => 'application/x-rar',
|
559
|
+
'tar' => 'application/x-tar',
|
560
|
+
#'rar' => 'application/x-rar-compressed',
|
561
|
+
'7z' => 'application/x-7z-compressed',
|
562
|
+
# texts
|
563
|
+
'txt' => 'text/plain',
|
564
|
+
'php' => 'text/x-php',
|
565
|
+
'html' => 'text/html',
|
566
|
+
'htm' => 'text/html',
|
567
|
+
'js' => 'text/javascript',
|
568
|
+
'css' => 'text/css',
|
569
|
+
'rtf' => 'text/rtf',
|
570
|
+
'rtfd' => 'text/rtfd',
|
571
|
+
'py' => 'text/x-python',
|
572
|
+
'java' => 'text/x-java-source',
|
573
|
+
'rb' => 'text/x-ruby',
|
574
|
+
'erb' => 'text/x-ruby',
|
575
|
+
'sh' => 'text/x-shellscript',
|
576
|
+
'pl' => 'text/x-perl',
|
577
|
+
'sql' => 'text/x-sql',
|
578
|
+
# images
|
579
|
+
'bmp' => 'image/x-ms-bmp',
|
580
|
+
'jpg' => 'image/jpeg',
|
581
|
+
'jpeg' => 'image/jpeg',
|
582
|
+
'gif' => 'image/gif',
|
583
|
+
'png' => 'image/png',
|
584
|
+
'tif' => 'image/tiff',
|
585
|
+
'tiff' => 'image/tiff',
|
586
|
+
'tga' => 'image/x-targa',
|
587
|
+
'psd' => 'image/vnd.adobe.photoshop',
|
588
|
+
'ico' => 'image/x-icon',
|
589
|
+
# audio
|
590
|
+
'mp3' => 'audio/mpeg',
|
591
|
+
'mid' => 'audio/midi',
|
592
|
+
'ogg' => 'audio/ogg',
|
593
|
+
'mp4a' => 'audio/mp4',
|
594
|
+
'wav' => 'audio/wav',
|
595
|
+
'wma' => 'audio/x-ms-wma',
|
596
|
+
# video
|
597
|
+
'avi' => 'video/x-msvideo',
|
598
|
+
'dv' => 'video/x-dv',
|
599
|
+
'mp4' => 'video/mp4',
|
600
|
+
'mpeg' => 'video/mpeg',
|
601
|
+
'mpg' => 'video/mpeg',
|
602
|
+
'mov' => 'video/quicktime',
|
603
|
+
'wm' => 'video/x-ms-wmv',
|
604
|
+
'flv' => 'video/x-flv',
|
605
|
+
'mkv' => 'video/x-matroska'
|
606
|
+
}
|
607
|
+
permission.merge!(allowed_mime)
|
608
|
+
permission.delete_if {|key| disallowed_mime.include?(key) }
|
609
|
+
permission
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fcfinder
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
initializer "fcfinder.assets.precompile" do |app|
|
4
|
+
#app.config.assets.precompile += %w(../../vendor/assets/fcfinder/*)
|
5
|
+
#app.config.assets.precompile += %w(../vendor/assets/images/fcfinder/*)
|
6
|
+
#app.config.assets.precompile += %w(fcfinder.css.erb)
|
7
|
+
app.config.assets.precompile += %w(assets/images/fcfinder/*)
|
8
|
+
app.config.assets.precompile += %w(fcfinder.css)
|
9
|
+
app.config.assets.precompile += %w(fcfinder.js)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This is a simple example which uses rubyzip to
|
2
|
+
# recursively generate a zip file from the contents of
|
3
|
+
# a specified directory. The directory itself is not
|
4
|
+
# included in the archive, rather just its contents.
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
# directoryToZip = "/tmp/input"
|
8
|
+
# outputFile = "/tmp/out.zip"
|
9
|
+
# zf = ZipFileGenerator.new(directoryToZip, outputFile)
|
10
|
+
# zf.write()
|
11
|
+
module Fcfinder
|
12
|
+
class ZipFileGenerator
|
13
|
+
# Initialize with the directory to zip and the location of the output archive.
|
14
|
+
def initialize(inputDir, outputFile)
|
15
|
+
@inputDir = inputDir
|
16
|
+
@outputFile = outputFile
|
17
|
+
end
|
18
|
+
|
19
|
+
# Zip the input directory.
|
20
|
+
def write()
|
21
|
+
entries = Dir.entries(@inputDir); entries.delete("."); entries.delete("..")
|
22
|
+
io = Zip::File.open(@outputFile, Zip::File::CREATE);
|
23
|
+
|
24
|
+
writeEntries(entries, "", io)
|
25
|
+
io.close();
|
26
|
+
end
|
27
|
+
|
28
|
+
# A helper method to make the recursion work.
|
29
|
+
private
|
30
|
+
def writeEntries(entries, path, io)
|
31
|
+
|
32
|
+
entries.each { |e|
|
33
|
+
zipFilePath = path == "" ? e : File.join(path, e)
|
34
|
+
diskFilePath = File.join(@inputDir, zipFilePath)
|
35
|
+
puts "Deflating " + diskFilePath
|
36
|
+
if File.directory?(diskFilePath)
|
37
|
+
io.mkdir(zipFilePath)
|
38
|
+
subdir =Dir.entries(diskFilePath); subdir.delete("."); subdir.delete("..")
|
39
|
+
writeEntries(subdir, zipFilePath, io)
|
40
|
+
else
|
41
|
+
io.get_output_stream(zipFilePath) { |f| f.puts(File.open(diskFilePath, "rb").read())}
|
42
|
+
end
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
data/lib/fcfinder.rb
ADDED
Binary file
|
Binary file
|