saphira 0.1.0 → 0.1.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (665) hide show
  1. data/app/assets/images/saphira/cancel.png +0 -0
  2. data/app/assets/images/saphira/com/adobe/air/logging/FileTarget.as +98 -0
  3. data/app/assets/images/saphira/com/adobe/crypto/HMAC.as +127 -0
  4. data/app/assets/images/saphira/com/adobe/crypto/MD5.as +281 -0
  5. data/app/assets/images/saphira/com/adobe/crypto/MD5Stream.as +402 -0
  6. data/app/assets/images/saphira/com/adobe/crypto/SHA1.as +271 -0
  7. data/app/assets/images/saphira/com/adobe/crypto/SHA224.as +257 -0
  8. data/app/assets/images/saphira/com/adobe/crypto/SHA256.as +261 -0
  9. data/app/assets/images/saphira/com/adobe/crypto/WSSEUsernameToken.as +114 -0
  10. data/app/assets/images/saphira/com/adobe/errors/IllegalStateError.as +63 -0
  11. data/app/assets/images/saphira/com/adobe/fileformats/vcard/Address.as +47 -0
  12. data/app/assets/images/saphira/com/adobe/fileformats/vcard/Email.as +39 -0
  13. data/app/assets/images/saphira/com/adobe/fileformats/vcard/Phone.as +39 -0
  14. data/app/assets/images/saphira/com/adobe/fileformats/vcard/VCard.as +54 -0
  15. data/app/assets/images/saphira/com/adobe/fileformats/vcard/VCardParser.as +246 -0
  16. data/app/assets/images/saphira/com/adobe/images/BitString.as +39 -0
  17. data/app/assets/images/saphira/com/adobe/images/JPGEncoder.as +648 -0
  18. data/app/assets/images/saphira/com/adobe/images/PNGEncoder.as +141 -0
  19. data/app/assets/images/saphira/com/adobe/net/DynamicURLLoader.as +55 -0
  20. data/app/assets/images/saphira/com/adobe/net/IURIResolver.as +76 -0
  21. data/app/assets/images/saphira/com/adobe/net/MimeTypeMap.as +196 -0
  22. data/app/assets/images/saphira/com/adobe/net/URI.as +2466 -0
  23. data/app/assets/images/saphira/com/adobe/net/URIEncodingBitmap.as +139 -0
  24. data/app/assets/images/saphira/com/adobe/net/proxies/RFC2817Socket.as +198 -0
  25. data/app/assets/images/saphira/com/adobe/protocols/dict/Database.as +34 -0
  26. data/app/assets/images/saphira/com/adobe/protocols/dict/Definition.as +39 -0
  27. data/app/assets/images/saphira/com/adobe/protocols/dict/Dict.as +328 -0
  28. data/app/assets/images/saphira/com/adobe/protocols/dict/DictionaryServer.as +28 -0
  29. data/app/assets/images/saphira/com/adobe/protocols/dict/MatchStrategy.as +34 -0
  30. data/app/assets/images/saphira/com/adobe/protocols/dict/Response.as +39 -0
  31. data/app/assets/images/saphira/com/adobe/protocols/dict/events/ConnectedEvent.as +14 -0
  32. data/app/assets/images/saphira/com/adobe/protocols/dict/events/DatabaseEvent.as +26 -0
  33. data/app/assets/images/saphira/com/adobe/protocols/dict/events/DefinitionEvent.as +27 -0
  34. data/app/assets/images/saphira/com/adobe/protocols/dict/events/DefinitionHeaderEvent.as +26 -0
  35. data/app/assets/images/saphira/com/adobe/protocols/dict/events/DictionaryServerEvent.as +26 -0
  36. data/app/assets/images/saphira/com/adobe/protocols/dict/events/DisconnectedEvent.as +14 -0
  37. data/app/assets/images/saphira/com/adobe/protocols/dict/events/ErrorEvent.as +37 -0
  38. data/app/assets/images/saphira/com/adobe/protocols/dict/events/MatchEvent.as +26 -0
  39. data/app/assets/images/saphira/com/adobe/protocols/dict/events/MatchStrategiesEvent.as +26 -0
  40. data/app/assets/images/saphira/com/adobe/protocols/dict/events/NoMatchEvent.as +14 -0
  41. data/app/assets/images/saphira/com/adobe/protocols/dict/util/CompleteResponseEvent.as +25 -0
  42. data/app/assets/images/saphira/com/adobe/protocols/dict/util/SocketHelper.as +49 -0
  43. data/app/assets/images/saphira/com/adobe/serialization/json/JSON.as +85 -0
  44. data/app/assets/images/saphira/com/adobe/serialization/json/JSONDecoder.as +221 -0
  45. data/app/assets/images/saphira/com/adobe/serialization/json/JSONEncoder.as +299 -0
  46. data/app/assets/images/saphira/com/adobe/serialization/json/JSONParseError.as +87 -0
  47. data/app/assets/images/saphira/com/adobe/serialization/json/JSONToken.as +104 -0
  48. data/app/assets/images/saphira/com/adobe/serialization/json/JSONTokenType.as +67 -0
  49. data/app/assets/images/saphira/com/adobe/serialization/json/JSONTokenizer.as +583 -0
  50. data/app/assets/images/saphira/com/adobe/utils/ArrayUtil.as +187 -0
  51. data/app/assets/images/saphira/com/adobe/utils/DateUtil.as +699 -0
  52. data/app/assets/images/saphira/com/adobe/utils/DictionaryUtil.as +87 -0
  53. data/app/assets/images/saphira/com/adobe/utils/IntUtil.as +99 -0
  54. data/app/assets/images/saphira/com/adobe/utils/NumberFormatter.as +74 -0
  55. data/app/assets/images/saphira/com/adobe/utils/StringUtil.as +270 -0
  56. data/app/assets/images/saphira/com/adobe/utils/XMLUtil.as +168 -0
  57. data/app/assets/images/saphira/com/adobe/webapis/ServiceBase.as +48 -0
  58. data/app/assets/images/saphira/com/adobe/webapis/URLLoaderBase.as +108 -0
  59. data/app/assets/images/saphira/com/adobe/webapis/events/ServiceEvent.as +75 -0
  60. data/app/assets/images/saphira/expressInstall.swf +0 -0
  61. data/app/assets/images/saphira/jcrop.gif +0 -0
  62. data/app/assets/images/saphira/uploadify.allglyphs.swf +0 -0
  63. data/app/assets/images/saphira/uploadify.fla +0 -0
  64. data/app/assets/images/saphira/uploadify.swf +0 -0
  65. data/app/assets/javascripts/saphira/image_variant_settings.js +2 -0
  66. data/app/assets/javascripts/saphira/image_variants.js +2 -0
  67. data/app/assets/javascripts/saphira/jquery.color.js +123 -0
  68. data/app/assets/javascripts/saphira/jquery.jcrop.js +1600 -0
  69. data/app/assets/javascripts/saphira/jquery.uploadify.v2.1.4.js +296 -0
  70. data/app/assets/javascripts/saphira/swfobject.js +4 -0
  71. data/app/assets/stylesheets/saphira/image_variant_settings.css +4 -0
  72. data/app/assets/stylesheets/saphira/image_variants.css +4 -0
  73. data/app/assets/stylesheets/saphira/jquery.jcrop.css +35 -0
  74. data/app/assets/stylesheets/saphira/uploadify.css +52 -0
  75. data/app/controllers/saphira/file_items_controller.rb +8 -1
  76. data/app/controllers/saphira/image_variant_settings_controller.rb +41 -0
  77. data/app/controllers/saphira/image_variants_controller.rb +85 -0
  78. data/app/helpers/saphira/image_variant_settings_helper.rb +4 -0
  79. data/app/helpers/saphira/image_variants_helper.rb +4 -0
  80. data/app/models/saphira/file_item.rb +43 -0
  81. data/app/models/saphira/image_variant.rb +4 -0
  82. data/app/views/layouts/saphira/application.html.erb +5 -0
  83. data/app/views/saphira/file_items/index.html.erb +4 -3
  84. data/app/views/saphira/file_items/show.html.erb +16 -1
  85. data/app/views/saphira/file_items/upload_files.html.erb +33 -0
  86. data/app/views/saphira/image_variant_settings/edit.html.erb +18 -0
  87. data/app/views/saphira/image_variant_settings/show.html.erb +55 -0
  88. data/app/views/saphira/image_variant_settings/update.html.erb +2 -0
  89. data/app/views/saphira/image_variants/_form.html.erb +29 -0
  90. data/app/views/saphira/image_variants/edit.html.erb +6 -0
  91. data/app/views/saphira/image_variants/index.html.erb +27 -0
  92. data/app/views/saphira/image_variants/new.html.erb +5 -0
  93. data/app/views/saphira/image_variants/show.html.erb +21 -0
  94. data/config/initializers/dragonfly.rb +10 -1
  95. data/config/initializers/helpers.rb +5 -0
  96. data/config/initializers/mini_magick.rb +1 -0
  97. data/config/routes.rb +5 -1
  98. data/db/migrate/20110909143712_create_saphira_image_variants.rb +11 -0
  99. data/lib/saphira/engine.rb +9 -0
  100. data/lib/saphira/helpers/form_builder.rb +19 -0
  101. data/lib/saphira/helpers/form_helper.rb +69 -0
  102. data/lib/saphira/middleware/flash_session_cookie.rb +23 -0
  103. data/lib/saphira/version.rb +1 -1
  104. data/test/dummy/config/initializers/pry.rb +1 -0
  105. data/test/dummy/db/development.sqlite3 +0 -0
  106. data/test/dummy/db/migrate/20110909143951_create_saphira_image_variants.rb +11 -0
  107. data/test/dummy/db/schema.rb +9 -1
  108. data/test/dummy/db/test.sqlite3 +0 -0
  109. data/test/dummy/features/manage_file_items.feature +2 -1
  110. data/test/dummy/features/manage_image_variants.feature +24 -0
  111. data/test/dummy/features/step_definitions/file_item_steps.rb +19 -0
  112. data/test/dummy/features/step_definitions/image_variant_steps.rb +31 -0
  113. data/test/dummy/features/support/env.rb +2 -0
  114. data/test/dummy/features/support/paths.rb +3 -0
  115. data/test/dummy/lib/tasks/custom.rake +3 -0
  116. data/test/dummy/log/development.log +54425 -0
  117. data/test/dummy/log/test.log +15514 -0
  118. data/test/dummy/system/files/development/2011/09/09/16_51_37_135_IMG_4704.JPG +0 -0
  119. data/test/dummy/system/files/development/2011/09/09/16_51_37_135_IMG_4704.JPG.meta +1 -0
  120. data/test/dummy/system/files/development/2011/09/09/16_54_54_247_IMG_4707.JPG +0 -0
  121. data/test/dummy/system/files/development/2011/09/09/16_54_54_247_IMG_4707.JPG.meta +1 -0
  122. data/test/dummy/system/files/development/2011/09/09/18_26_01_701_IMG_4712.JPG +0 -0
  123. data/test/dummy/system/files/development/2011/09/09/18_26_01_701_IMG_4712.JPG.meta +1 -0
  124. data/test/dummy/system/files/development/2011/09/20/10_54_49_597_G_rtz1_2040_1_CMYK.jpg +0 -0
  125. data/test/dummy/system/files/development/2011/09/20/10_54_49_597_G_rtz1_2040_1_CMYK.jpg.meta +1 -0
  126. data/test/dummy/system/files/development/2011/09/20/12_44_23_621_DSC02119.JPG +0 -0
  127. data/test/dummy/system/files/development/2011/09/20/12_44_23_621_DSC02119.JPG.meta +1 -0
  128. data/test/dummy/system/files/development/2011/09/20/12_46_58_387_DSC02119.JPG +0 -0
  129. data/test/dummy/system/files/development/2011/09/20/12_46_58_387_DSC02119.JPG.meta +1 -0
  130. data/test/dummy/system/files/development/2011/09/20/12_49_02_756_DSC02120.JPG +0 -0
  131. data/test/dummy/system/files/development/2011/09/20/12_49_02_756_DSC02120.JPG.meta +1 -0
  132. data/test/dummy/system/files/development/2011/09/20/12_50_19_290_G_rtz1_0989_2_CMYK.jpg +0 -0
  133. data/test/dummy/system/files/development/2011/09/20/12_50_19_290_G_rtz1_0989_2_CMYK.jpg.meta +1 -0
  134. data/test/dummy/system/files/development/2011/09/20/12_50_23_519_G_rtz1_1628_1_CMYK.jpg +0 -0
  135. data/test/dummy/system/files/development/2011/09/20/12_50_23_519_G_rtz1_1628_1_CMYK.jpg.meta +1 -0
  136. data/test/dummy/system/files/development/2011/09/20/12_50_26_44_G_rtz1_1663_CMYK.jpg +0 -0
  137. data/test/dummy/system/files/development/2011/09/20/12_50_26_44_G_rtz1_1663_CMYK.jpg.meta +1 -0
  138. data/test/dummy/system/files/development/2011/09/20/12_50_27_954_G_rtz1_2040_1_CMYK.jpg +0 -0
  139. data/test/dummy/system/files/development/2011/09/20/12_50_27_954_G_rtz1_2040_1_CMYK.jpg.meta +1 -0
  140. data/test/dummy/system/files/development/2011/09/20/12_54_44_373_G_rtz1_1628_1_CMYK.jpg +0 -0
  141. data/test/dummy/system/files/development/2011/09/20/12_54_44_373_G_rtz1_1628_1_CMYK.jpg.meta +1 -0
  142. data/test/dummy/system/files/development/2011/09/20/12_54_46_193_G_rtz1_1663_CMYK.jpg +0 -0
  143. data/test/dummy/system/files/development/2011/09/20/12_54_46_193_G_rtz1_1663_CMYK.jpg.meta +1 -0
  144. data/test/dummy/system/files/development/2011/09/20/12_54_49_17_G_rtz1_2040_1_CMYK.jpg +0 -0
  145. data/test/dummy/system/files/development/2011/09/20/12_54_49_17_G_rtz1_2040_1_CMYK.jpg.meta +1 -0
  146. data/test/dummy/system/files/test/2011/09/09/09_58_11_308_eos_550d_wrong_orientation.jpg +0 -0
  147. data/test/dummy/system/files/test/2011/09/09/09_58_11_308_eos_550d_wrong_orientation.jpg.meta +1 -0
  148. data/test/dummy/system/files/test/2011/09/09/09_58_12_5_some_text.txt +99 -0
  149. data/test/dummy/system/files/test/2011/09/09/09_58_12_5_some_text.txt.meta +1 -0
  150. data/test/dummy/system/files/test/2011/09/09/10_00_33_577_eos_550d_wrong_orientation.jpg +0 -0
  151. data/test/dummy/system/files/test/2011/09/09/10_00_33_577_eos_550d_wrong_orientation.jpg.meta +1 -0
  152. data/test/dummy/system/files/test/2011/09/09/10_00_34_245_some_text.txt +99 -0
  153. data/test/dummy/system/files/test/2011/09/09/10_00_34_245_some_text.txt.meta +1 -0
  154. data/test/dummy/system/files/test/2011/09/09/10_01_37_537_eos_550d_wrong_orientation.jpg +0 -0
  155. data/test/dummy/system/files/test/2011/09/09/10_01_37_537_eos_550d_wrong_orientation.jpg.meta +1 -0
  156. data/test/dummy/system/files/test/2011/09/09/10_01_38_188_some_text.txt +99 -0
  157. data/test/dummy/system/files/test/2011/09/09/10_01_38_188_some_text.txt.meta +1 -0
  158. data/test/dummy/system/files/test/2011/09/09/10_02_53_234_eos_550d_wrong_orientation.jpg +0 -0
  159. data/test/dummy/system/files/test/2011/09/09/10_02_53_234_eos_550d_wrong_orientation.jpg.meta +1 -0
  160. data/test/dummy/system/files/test/2011/09/09/10_02_53_906_some_text.txt +99 -0
  161. data/test/dummy/system/files/test/2011/09/09/10_02_53_906_some_text.txt.meta +1 -0
  162. data/test/dummy/system/files/test/2011/09/09/10_02_56_34_eos_550d_wrong_orientation.jpg +0 -0
  163. data/test/dummy/system/files/test/2011/09/09/10_02_56_34_eos_550d_wrong_orientation.jpg.meta +1 -0
  164. data/test/dummy/system/files/test/2011/09/09/10_04_33_416_eos_550d_wrong_orientation.jpg +0 -0
  165. data/test/dummy/system/files/test/2011/09/09/10_04_33_416_eos_550d_wrong_orientation.jpg.meta +1 -0
  166. data/test/dummy/system/files/test/2011/09/09/10_04_34_69_some_text.txt +99 -0
  167. data/test/dummy/system/files/test/2011/09/09/10_04_34_69_some_text.txt.meta +1 -0
  168. data/test/dummy/system/files/test/2011/09/09/10_05_05_475_eos_550d_wrong_orientation.jpg +0 -0
  169. data/test/dummy/system/files/test/2011/09/09/10_05_05_475_eos_550d_wrong_orientation.jpg.meta +1 -0
  170. data/test/dummy/system/files/test/2011/09/09/10_05_06_447_some_text.txt +99 -0
  171. data/test/dummy/system/files/test/2011/09/09/10_05_06_447_some_text.txt.meta +1 -0
  172. data/test/dummy/system/files/test/2011/09/09/10_05_08_609_eos_550d_wrong_orientation.jpg +0 -0
  173. data/test/dummy/system/files/test/2011/09/09/10_05_08_609_eos_550d_wrong_orientation.jpg.meta +1 -0
  174. data/test/dummy/system/files/test/2011/09/09/10_06_34_64_eos_550d_wrong_orientation.jpg +0 -0
  175. data/test/dummy/system/files/test/2011/09/09/10_06_34_64_eos_550d_wrong_orientation.jpg.meta +1 -0
  176. data/test/dummy/system/files/test/2011/09/09/10_06_34_786_some_text.txt +99 -0
  177. data/test/dummy/system/files/test/2011/09/09/10_06_34_786_some_text.txt.meta +1 -0
  178. data/test/dummy/system/files/test/2011/09/09/10_06_49_889_eos_550d_wrong_orientation.jpg +0 -0
  179. data/test/dummy/system/files/test/2011/09/09/10_06_49_889_eos_550d_wrong_orientation.jpg.meta +1 -0
  180. data/test/dummy/system/files/test/2011/09/09/10_06_50_544_some_text.txt +99 -0
  181. data/test/dummy/system/files/test/2011/09/09/10_06_50_544_some_text.txt.meta +1 -0
  182. data/test/dummy/system/files/test/2011/09/09/10_08_33_687_eos_550d_wrong_orientation.jpg +0 -0
  183. data/test/dummy/system/files/test/2011/09/09/10_08_33_687_eos_550d_wrong_orientation.jpg.meta +1 -0
  184. data/test/dummy/system/files/test/2011/09/09/10_08_34_411_some_text.txt +99 -0
  185. data/test/dummy/system/files/test/2011/09/09/10_08_34_411_some_text.txt.meta +1 -0
  186. data/test/dummy/system/files/test/2011/09/09/10_09_07_292_eos_550d_wrong_orientation.jpg +0 -0
  187. data/test/dummy/system/files/test/2011/09/09/10_09_07_292_eos_550d_wrong_orientation.jpg.meta +1 -0
  188. data/test/dummy/system/files/test/2011/09/09/10_09_07_624_some_text.txt +99 -0
  189. data/test/dummy/system/files/test/2011/09/09/10_09_07_624_some_text.txt.meta +1 -0
  190. data/test/dummy/system/files/test/2011/09/09/10_09_23_158_eos_550d_wrong_orientation.jpg +0 -0
  191. data/test/dummy/system/files/test/2011/09/09/10_09_23_158_eos_550d_wrong_orientation.jpg.meta +1 -0
  192. data/test/dummy/system/files/test/2011/09/09/10_09_23_495_some_text.txt +99 -0
  193. data/test/dummy/system/files/test/2011/09/09/10_09_23_495_some_text.txt.meta +1 -0
  194. data/test/dummy/system/files/test/2011/09/09/10_10_43_742_eos_550d_wrong_orientation.jpg +0 -0
  195. data/test/dummy/system/files/test/2011/09/09/10_10_43_742_eos_550d_wrong_orientation.jpg.meta +1 -0
  196. data/test/dummy/system/files/test/2011/09/09/10_10_44_475_some_text.txt +99 -0
  197. data/test/dummy/system/files/test/2011/09/09/10_10_44_475_some_text.txt.meta +1 -0
  198. data/test/dummy/system/files/test/2011/09/09/10_10_59_650_eos_550d_wrong_orientation.jpg +0 -0
  199. data/test/dummy/system/files/test/2011/09/09/10_10_59_650_eos_550d_wrong_orientation.jpg.meta +1 -0
  200. data/test/dummy/system/files/test/2011/09/09/10_11_00_294_some_text.txt +99 -0
  201. data/test/dummy/system/files/test/2011/09/09/10_11_00_294_some_text.txt.meta +1 -0
  202. data/test/dummy/system/files/test/2011/09/09/10_21_22_164_eos_550d_wrong_orientation.jpg +0 -0
  203. data/test/dummy/system/files/test/2011/09/09/10_21_22_164_eos_550d_wrong_orientation.jpg.meta +1 -0
  204. data/test/dummy/system/files/test/2011/09/09/10_21_23_90_some_text.txt +99 -0
  205. data/test/dummy/system/files/test/2011/09/09/10_21_23_90_some_text.txt.meta +1 -0
  206. data/test/dummy/system/files/test/2011/09/09/10_21_38_479_eos_550d_wrong_orientation.jpg +0 -0
  207. data/test/dummy/system/files/test/2011/09/09/10_21_38_479_eos_550d_wrong_orientation.jpg.meta +1 -0
  208. data/test/dummy/system/files/test/2011/09/09/10_21_39_225_some_text.txt +99 -0
  209. data/test/dummy/system/files/test/2011/09/09/10_21_39_225_some_text.txt.meta +1 -0
  210. data/test/dummy/system/files/test/2011/09/09/10_21_55_560_eos_550d_wrong_orientation.jpg +0 -0
  211. data/test/dummy/system/files/test/2011/09/09/10_21_55_560_eos_550d_wrong_orientation.jpg.meta +1 -0
  212. data/test/dummy/system/files/test/2011/09/09/10_21_56_332_some_text.txt +99 -0
  213. data/test/dummy/system/files/test/2011/09/09/10_21_56_332_some_text.txt.meta +1 -0
  214. data/test/dummy/system/files/test/2011/09/09/10_25_03_122_eos_550d_wrong_orientation.jpg +0 -0
  215. data/test/dummy/system/files/test/2011/09/09/10_25_03_122_eos_550d_wrong_orientation.jpg.meta +1 -0
  216. data/test/dummy/system/files/test/2011/09/09/10_25_04_108_some_text.txt +99 -0
  217. data/test/dummy/system/files/test/2011/09/09/10_25_04_108_some_text.txt.meta +1 -0
  218. data/test/dummy/system/files/test/2011/09/09/10_25_42_747_eos_550d_wrong_orientation.jpg +0 -0
  219. data/test/dummy/system/files/test/2011/09/09/10_25_42_747_eos_550d_wrong_orientation.jpg.meta +1 -0
  220. data/test/dummy/system/files/test/2011/09/09/10_25_43_407_some_text.txt +99 -0
  221. data/test/dummy/system/files/test/2011/09/09/10_25_43_407_some_text.txt.meta +1 -0
  222. data/test/dummy/system/files/test/2011/09/09/10_25_58_973_eos_550d_wrong_orientation.jpg +0 -0
  223. data/test/dummy/system/files/test/2011/09/09/10_25_58_973_eos_550d_wrong_orientation.jpg.meta +1 -0
  224. data/test/dummy/system/files/test/2011/09/09/10_41_33_628_some_text.txt +99 -0
  225. data/test/dummy/system/files/test/2011/09/09/10_41_33_628_some_text.txt.meta +1 -0
  226. data/test/dummy/system/files/test/2011/09/09/10_42_34_411_eos_550d_wrong_orientation.jpg +0 -0
  227. data/test/dummy/system/files/test/2011/09/09/10_42_34_411_eos_550d_wrong_orientation.jpg.meta +1 -0
  228. data/test/dummy/system/files/test/2011/09/09/10_42_35_234_some_text.txt +99 -0
  229. data/test/dummy/system/files/test/2011/09/09/10_42_35_234_some_text.txt.meta +1 -0
  230. data/test/dummy/system/files/test/2011/09/09/10_42_59_862_eos_550d_wrong_orientation.jpg +0 -0
  231. data/test/dummy/system/files/test/2011/09/09/10_42_59_862_eos_550d_wrong_orientation.jpg.meta +1 -0
  232. data/test/dummy/system/files/test/2011/09/09/10_44_16_115_some_text.txt +99 -0
  233. data/test/dummy/system/files/test/2011/09/09/10_44_16_115_some_text.txt.meta +1 -0
  234. data/test/dummy/system/files/test/2011/09/09/10_44_32_193_eos_550d_wrong_orientation.jpg +0 -0
  235. data/test/dummy/system/files/test/2011/09/09/10_44_32_193_eos_550d_wrong_orientation.jpg.meta +1 -0
  236. data/test/dummy/system/files/test/2011/09/09/10_44_33_135_some_text.txt +99 -0
  237. data/test/dummy/system/files/test/2011/09/09/10_44_33_135_some_text.txt.meta +1 -0
  238. data/test/dummy/system/files/test/2011/09/09/10_45_51_831_eos_550d_wrong_orientation.jpg +0 -0
  239. data/test/dummy/system/files/test/2011/09/09/10_45_51_831_eos_550d_wrong_orientation.jpg.meta +1 -0
  240. data/test/dummy/system/files/test/2011/09/09/10_51_00_989_some_text.txt +99 -0
  241. data/test/dummy/system/files/test/2011/09/09/10_51_00_989_some_text.txt.meta +1 -0
  242. data/test/dummy/system/files/test/2011/09/09/10_51_16_925_eos_550d_wrong_orientation.jpg +0 -0
  243. data/test/dummy/system/files/test/2011/09/09/10_51_16_925_eos_550d_wrong_orientation.jpg.meta +1 -0
  244. data/test/dummy/system/files/test/2011/09/09/10_51_17_404_some_text.txt +99 -0
  245. data/test/dummy/system/files/test/2011/09/09/10_51_17_404_some_text.txt.meta +1 -0
  246. data/test/dummy/system/files/test/2011/09/09/10_51_33_795_eos_550d_wrong_orientation.jpg +0 -0
  247. data/test/dummy/system/files/test/2011/09/09/10_51_33_795_eos_550d_wrong_orientation.jpg.meta +1 -0
  248. data/test/dummy/system/files/test/2011/09/09/10_51_34_266_some_text.txt +99 -0
  249. data/test/dummy/system/files/test/2011/09/09/10_51_34_266_some_text.txt.meta +1 -0
  250. data/test/dummy/system/files/test/2011/09/09/11_55_24_773_eos_550d_wrong_orientation.jpg +0 -0
  251. data/test/dummy/system/files/test/2011/09/09/11_55_24_773_eos_550d_wrong_orientation.jpg.meta +1 -0
  252. data/test/dummy/system/files/test/2011/09/09/11_55_25_251_some_text.txt +99 -0
  253. data/test/dummy/system/files/test/2011/09/09/11_55_25_251_some_text.txt.meta +1 -0
  254. data/test/dummy/system/files/test/2011/09/09/12_29_13_951_eos_550d_wrong_orientation.jpg +0 -0
  255. data/test/dummy/system/files/test/2011/09/09/12_29_13_951_eos_550d_wrong_orientation.jpg.meta +1 -0
  256. data/test/dummy/system/files/test/2011/09/09/12_29_14_948_some_text.txt +99 -0
  257. data/test/dummy/system/files/test/2011/09/09/12_29_14_948_some_text.txt.meta +1 -0
  258. data/test/dummy/system/files/test/2011/09/09/12_29_31_320_eos_550d_wrong_orientation.jpg +0 -0
  259. data/test/dummy/system/files/test/2011/09/09/12_29_31_320_eos_550d_wrong_orientation.jpg.meta +1 -0
  260. data/test/dummy/system/files/test/2011/09/09/12_29_45_558_eos_550d_wrong_orientation.jpg +0 -0
  261. data/test/dummy/system/files/test/2011/09/09/12_29_45_558_eos_550d_wrong_orientation.jpg.meta +1 -0
  262. data/test/dummy/system/files/test/2011/09/09/12_29_46_46_some_text.txt +99 -0
  263. data/test/dummy/system/files/test/2011/09/09/12_29_46_46_some_text.txt.meta +1 -0
  264. data/test/dummy/system/files/test/2011/09/09/12_30_02_482_eos_550d_wrong_orientation.jpg +0 -0
  265. data/test/dummy/system/files/test/2011/09/09/12_30_02_482_eos_550d_wrong_orientation.jpg.meta +1 -0
  266. data/test/dummy/system/files/test/2011/09/09/12_30_02_976_some_text.txt +99 -0
  267. data/test/dummy/system/files/test/2011/09/09/12_30_02_976_some_text.txt.meta +1 -0
  268. data/test/dummy/system/files/test/2011/09/09/12_30_28_555_eos_550d_wrong_orientation.jpg +0 -0
  269. data/test/dummy/system/files/test/2011/09/09/12_30_28_555_eos_550d_wrong_orientation.jpg.meta +1 -0
  270. data/test/dummy/system/files/test/2011/09/09/12_30_29_27_some_text.txt +99 -0
  271. data/test/dummy/system/files/test/2011/09/09/12_30_29_27_some_text.txt.meta +1 -0
  272. data/test/dummy/system/files/test/2011/09/09/12_32_59_361_eos_550d_wrong_orientation.jpg +0 -0
  273. data/test/dummy/system/files/test/2011/09/09/12_32_59_361_eos_550d_wrong_orientation.jpg.meta +1 -0
  274. data/test/dummy/system/files/test/2011/09/09/12_32_59_829_some_text.txt +99 -0
  275. data/test/dummy/system/files/test/2011/09/09/12_32_59_829_some_text.txt.meta +1 -0
  276. data/test/dummy/system/files/test/2011/09/09/12_33_28_536_some_text.txt +99 -0
  277. data/test/dummy/system/files/test/2011/09/09/12_33_28_536_some_text.txt.meta +1 -0
  278. data/test/dummy/system/files/test/2011/09/09/12_33_28_53_eos_550d_wrong_orientation.jpg +0 -0
  279. data/test/dummy/system/files/test/2011/09/09/12_33_28_53_eos_550d_wrong_orientation.jpg.meta +1 -0
  280. data/test/dummy/system/files/test/2011/09/09/16_30_50_311_eos_550d_wrong_orientation.jpg +0 -0
  281. data/test/dummy/system/files/test/2011/09/09/16_30_50_311_eos_550d_wrong_orientation.jpg.meta +1 -0
  282. data/test/dummy/system/files/test/2011/09/09/16_42_46_830_eos_550d_wrong_orientation.jpg +0 -0
  283. data/test/dummy/system/files/test/2011/09/09/16_42_46_830_eos_550d_wrong_orientation.jpg.meta +1 -0
  284. data/test/dummy/system/files/test/2011/09/09/16_43_08_154_eos_550d_wrong_orientation.jpg +0 -0
  285. data/test/dummy/system/files/test/2011/09/09/16_43_08_154_eos_550d_wrong_orientation.jpg.meta +1 -0
  286. data/test/dummy/system/files/test/2011/09/09/16_43_08_639_some_text.txt +99 -0
  287. data/test/dummy/system/files/test/2011/09/09/16_43_08_639_some_text.txt.meta +1 -0
  288. data/test/dummy/system/files/test/2011/09/09/16_43_39_562_eos_550d_wrong_orientation.jpg +0 -0
  289. data/test/dummy/system/files/test/2011/09/09/16_43_39_562_eos_550d_wrong_orientation.jpg.meta +1 -0
  290. data/test/dummy/system/files/test/2011/09/09/16_44_16_988_eos_550d_wrong_orientation.jpg +0 -0
  291. data/test/dummy/system/files/test/2011/09/09/16_44_16_988_eos_550d_wrong_orientation.jpg.meta +1 -0
  292. data/test/dummy/system/files/test/2011/09/09/16_44_44_6_eos_550d_wrong_orientation.jpg +0 -0
  293. data/test/dummy/system/files/test/2011/09/09/16_44_44_6_eos_550d_wrong_orientation.jpg.meta +1 -0
  294. data/test/dummy/system/files/test/2011/09/09/16_45_22_203_eos_550d_wrong_orientation.jpg +0 -0
  295. data/test/dummy/system/files/test/2011/09/09/16_45_22_203_eos_550d_wrong_orientation.jpg.meta +1 -0
  296. data/test/dummy/system/files/test/2011/09/09/16_45_22_694_some_text.txt +99 -0
  297. data/test/dummy/system/files/test/2011/09/09/16_45_22_694_some_text.txt.meta +1 -0
  298. data/test/dummy/system/files/test/2011/09/09/16_46_44_693_eos_550d_wrong_orientation.jpg +0 -0
  299. data/test/dummy/system/files/test/2011/09/09/16_46_44_693_eos_550d_wrong_orientation.jpg.meta +1 -0
  300. data/test/dummy/system/files/test/2011/09/09/16_48_14_349_eos_550d_wrong_orientation.jpg +0 -0
  301. data/test/dummy/system/files/test/2011/09/09/16_48_14_349_eos_550d_wrong_orientation.jpg.meta +1 -0
  302. data/test/dummy/system/files/test/2011/09/09/16_55_36_775_eos_550d_wrong_orientation.jpg +0 -0
  303. data/test/dummy/system/files/test/2011/09/09/16_55_36_775_eos_550d_wrong_orientation.jpg.meta +1 -0
  304. data/test/dummy/system/files/test/2011/09/09/16_56_10_433_some_text.txt +99 -0
  305. data/test/dummy/system/files/test/2011/09/09/16_56_10_433_some_text.txt.meta +1 -0
  306. data/test/dummy/system/files/test/2011/09/09/16_56_13_781_eos_550d_wrong_orientation.jpg +0 -0
  307. data/test/dummy/system/files/test/2011/09/09/16_56_13_781_eos_550d_wrong_orientation.jpg.meta +1 -0
  308. data/test/dummy/system/files/test/2011/09/09/16_57_19_642_eos_550d_wrong_orientation.jpg +0 -0
  309. data/test/dummy/system/files/test/2011/09/09/16_57_19_642_eos_550d_wrong_orientation.jpg.meta +1 -0
  310. data/test/dummy/system/files/test/2011/09/09/16_57_20_221_some_text.txt +99 -0
  311. data/test/dummy/system/files/test/2011/09/09/16_57_20_221_some_text.txt.meta +1 -0
  312. data/test/dummy/system/files/test/2011/09/09/16_57_22_478_eos_550d_wrong_orientation.jpg +0 -0
  313. data/test/dummy/system/files/test/2011/09/09/16_57_22_478_eos_550d_wrong_orientation.jpg.meta +1 -0
  314. data/test/dummy/system/files/test/2011/09/09/17_01_16_272_eos_550d_wrong_orientation.jpg +0 -0
  315. data/test/dummy/system/files/test/2011/09/09/17_01_16_272_eos_550d_wrong_orientation.jpg.meta +1 -0
  316. data/test/dummy/system/files/test/2011/09/09/17_01_16_773_some_text.txt +99 -0
  317. data/test/dummy/system/files/test/2011/09/09/17_01_16_773_some_text.txt.meta +1 -0
  318. data/test/dummy/system/files/test/2011/09/09/17_01_19_26_eos_550d_wrong_orientation.jpg +0 -0
  319. data/test/dummy/system/files/test/2011/09/09/17_01_19_26_eos_550d_wrong_orientation.jpg.meta +1 -0
  320. data/test/dummy/system/files/test/2011/09/09/17_02_57_539_eos_550d_wrong_orientation.jpg +0 -0
  321. data/test/dummy/system/files/test/2011/09/09/17_02_57_539_eos_550d_wrong_orientation.jpg.meta +1 -0
  322. data/test/dummy/system/files/test/2011/09/09/17_02_58_21_some_text.txt +99 -0
  323. data/test/dummy/system/files/test/2011/09/09/17_02_58_21_some_text.txt.meta +1 -0
  324. data/test/dummy/system/files/test/2011/09/09/17_03_00_478_eos_550d_wrong_orientation.jpg +0 -0
  325. data/test/dummy/system/files/test/2011/09/09/17_03_00_478_eos_550d_wrong_orientation.jpg.meta +1 -0
  326. data/test/dummy/system/files/test/2011/09/09/23_10_31_776_eos_550d_wrong_orientation.jpg +0 -0
  327. data/test/dummy/system/files/test/2011/09/09/23_10_31_776_eos_550d_wrong_orientation.jpg.meta +1 -0
  328. data/test/dummy/system/files/test/2011/09/09/23_10_32_270_some_text.txt +99 -0
  329. data/test/dummy/system/files/test/2011/09/09/23_10_32_270_some_text.txt.meta +1 -0
  330. data/test/dummy/system/files/test/2011/09/09/23_10_34_701_eos_550d_wrong_orientation.jpg +0 -0
  331. data/test/dummy/system/files/test/2011/09/09/23_10_34_701_eos_550d_wrong_orientation.jpg.meta +1 -0
  332. data/test/dummy/system/files/test/2011/09/09/23_11_16_395_eos_550d_wrong_orientation.jpg +0 -0
  333. data/test/dummy/system/files/test/2011/09/09/23_11_16_395_eos_550d_wrong_orientation.jpg.meta +1 -0
  334. data/test/dummy/system/files/test/2011/09/09/23_11_16_888_some_text.txt +99 -0
  335. data/test/dummy/system/files/test/2011/09/09/23_11_16_888_some_text.txt.meta +1 -0
  336. data/test/dummy/system/files/test/2011/09/09/23_11_19_298_eos_550d_wrong_orientation.jpg +0 -0
  337. data/test/dummy/system/files/test/2011/09/09/23_11_19_298_eos_550d_wrong_orientation.jpg.meta +1 -0
  338. data/test/dummy/system/files/test/2011/09/09/23_15_26_261_eos_550d_wrong_orientation.jpg +0 -0
  339. data/test/dummy/system/files/test/2011/09/09/23_15_26_261_eos_550d_wrong_orientation.jpg.meta +1 -0
  340. data/test/dummy/system/files/test/2011/09/09/23_15_26_928_some_text.txt +99 -0
  341. data/test/dummy/system/files/test/2011/09/09/23_15_26_928_some_text.txt.meta +1 -0
  342. data/test/dummy/system/files/test/2011/09/09/23_15_29_344_eos_550d_wrong_orientation.jpg +0 -0
  343. data/test/dummy/system/files/test/2011/09/09/23_15_29_344_eos_550d_wrong_orientation.jpg.meta +1 -0
  344. data/test/dummy/system/files/test/2011/09/09/23_16_21_552_eos_550d_wrong_orientation.jpg +0 -0
  345. data/test/dummy/system/files/test/2011/09/09/23_16_21_552_eos_550d_wrong_orientation.jpg.meta +1 -0
  346. data/test/dummy/system/files/test/2011/09/09/23_16_22_835_eos_550d_wrong_orientation.jpg +0 -0
  347. data/test/dummy/system/files/test/2011/09/09/23_16_22_835_eos_550d_wrong_orientation.jpg.meta +1 -0
  348. data/test/dummy/system/files/test/2011/09/09/23_18_27_524_eos_550d_wrong_orientation.jpg +0 -0
  349. data/test/dummy/system/files/test/2011/09/09/23_18_27_524_eos_550d_wrong_orientation.jpg.meta +1 -0
  350. data/test/dummy/system/files/test/2011/09/09/23_18_28_908_eos_550d_wrong_orientation.jpg +0 -0
  351. data/test/dummy/system/files/test/2011/09/09/23_18_28_908_eos_550d_wrong_orientation.jpg.meta +1 -0
  352. data/test/dummy/system/files/test/2011/09/09/23_19_14_156_eos_550d_wrong_orientation.jpg +0 -0
  353. data/test/dummy/system/files/test/2011/09/09/23_19_14_156_eos_550d_wrong_orientation.jpg.meta +1 -0
  354. data/test/dummy/system/files/test/2011/09/09/23_19_14_668_some_text.txt +99 -0
  355. data/test/dummy/system/files/test/2011/09/09/23_19_14_668_some_text.txt.meta +1 -0
  356. data/test/dummy/system/files/test/2011/09/09/23_19_17_92_eos_550d_wrong_orientation.jpg +0 -0
  357. data/test/dummy/system/files/test/2011/09/09/23_19_17_92_eos_550d_wrong_orientation.jpg.meta +1 -0
  358. data/test/dummy/system/files/test/2011/09/09/23_19_57_135_eos_550d_wrong_orientation.jpg +0 -0
  359. data/test/dummy/system/files/test/2011/09/09/23_19_57_135_eos_550d_wrong_orientation.jpg.meta +1 -0
  360. data/test/dummy/system/files/test/2011/09/09/23_19_57_628_some_text.txt +99 -0
  361. data/test/dummy/system/files/test/2011/09/09/23_19_57_628_some_text.txt.meta +1 -0
  362. data/test/dummy/system/files/test/2011/09/09/23_20_00_99_eos_550d_wrong_orientation.jpg +0 -0
  363. data/test/dummy/system/files/test/2011/09/09/23_20_00_99_eos_550d_wrong_orientation.jpg.meta +1 -0
  364. data/test/dummy/system/files/test/2011/09/09/23_20_39_80_eos_550d_wrong_orientation.jpg +0 -0
  365. data/test/dummy/system/files/test/2011/09/09/23_20_39_80_eos_550d_wrong_orientation.jpg.meta +1 -0
  366. data/test/dummy/system/files/test/2011/09/09/23_20_40_205_eos_550d_wrong_orientation.jpg +0 -0
  367. data/test/dummy/system/files/test/2011/09/09/23_20_40_205_eos_550d_wrong_orientation.jpg.meta +1 -0
  368. data/test/dummy/system/files/test/2011/09/09/23_21_01_631_eos_550d_wrong_orientation.jpg +0 -0
  369. data/test/dummy/system/files/test/2011/09/09/23_21_01_631_eos_550d_wrong_orientation.jpg.meta +1 -0
  370. data/test/dummy/system/files/test/2011/09/09/23_21_02_216_some_text.txt +99 -0
  371. data/test/dummy/system/files/test/2011/09/09/23_21_02_216_some_text.txt.meta +1 -0
  372. data/test/dummy/system/files/test/2011/09/09/23_21_04_557_eos_550d_wrong_orientation.jpg +0 -0
  373. data/test/dummy/system/files/test/2011/09/09/23_21_04_557_eos_550d_wrong_orientation.jpg.meta +1 -0
  374. data/test/dummy/system/files/test/2011/09/09/23_23_00_280_eos_550d_wrong_orientation.jpg +0 -0
  375. data/test/dummy/system/files/test/2011/09/09/23_23_00_280_eos_550d_wrong_orientation.jpg.meta +1 -0
  376. data/test/dummy/system/files/test/2011/09/09/23_23_00_777_some_text.txt +99 -0
  377. data/test/dummy/system/files/test/2011/09/09/23_23_00_777_some_text.txt.meta +1 -0
  378. data/test/dummy/system/files/test/2011/09/09/23_23_03_310_eos_550d_wrong_orientation.jpg +0 -0
  379. data/test/dummy/system/files/test/2011/09/09/23_23_03_310_eos_550d_wrong_orientation.jpg.meta +1 -0
  380. data/test/dummy/system/files/test/2011/09/09/23_24_04_367_eos_550d_wrong_orientation.jpg +0 -0
  381. data/test/dummy/system/files/test/2011/09/09/23_24_04_367_eos_550d_wrong_orientation.jpg.meta +1 -0
  382. data/test/dummy/system/files/test/2011/09/09/23_24_04_871_some_text.txt +99 -0
  383. data/test/dummy/system/files/test/2011/09/09/23_24_04_871_some_text.txt.meta +1 -0
  384. data/test/dummy/system/files/test/2011/09/09/23_24_07_303_eos_550d_wrong_orientation.jpg +0 -0
  385. data/test/dummy/system/files/test/2011/09/09/23_24_07_303_eos_550d_wrong_orientation.jpg.meta +1 -0
  386. data/test/dummy/system/files/test/2011/09/09/23_25_04_212_eos_550d_wrong_orientation.jpg +0 -0
  387. data/test/dummy/system/files/test/2011/09/09/23_25_04_212_eos_550d_wrong_orientation.jpg.meta +1 -0
  388. data/test/dummy/system/files/test/2011/09/09/23_25_06_520_eos_550d_wrong_orientation.jpg +0 -0
  389. data/test/dummy/system/files/test/2011/09/09/23_25_06_520_eos_550d_wrong_orientation.jpg.meta +1 -0
  390. data/test/dummy/system/files/test/2011/09/09/23_28_42_805_eos_550d_wrong_orientation.jpg +0 -0
  391. data/test/dummy/system/files/test/2011/09/09/23_28_42_805_eos_550d_wrong_orientation.jpg.meta +1 -0
  392. data/test/dummy/system/files/test/2011/09/09/23_28_43_315_some_text.txt +99 -0
  393. data/test/dummy/system/files/test/2011/09/09/23_28_43_315_some_text.txt.meta +1 -0
  394. data/test/dummy/system/files/test/2011/09/09/23_28_45_754_eos_550d_wrong_orientation.jpg +0 -0
  395. data/test/dummy/system/files/test/2011/09/09/23_28_45_754_eos_550d_wrong_orientation.jpg.meta +1 -0
  396. data/test/dummy/system/files/test/2011/09/09/23_30_10_146_eos_550d_wrong_orientation.jpg +0 -0
  397. data/test/dummy/system/files/test/2011/09/09/23_30_10_146_eos_550d_wrong_orientation.jpg.meta +1 -0
  398. data/test/dummy/system/files/test/2011/09/09/23_30_10_658_some_text.txt +99 -0
  399. data/test/dummy/system/files/test/2011/09/09/23_30_10_658_some_text.txt.meta +1 -0
  400. data/test/dummy/system/files/test/2011/09/09/23_30_13_84_eos_550d_wrong_orientation.jpg +0 -0
  401. data/test/dummy/system/files/test/2011/09/09/23_30_13_84_eos_550d_wrong_orientation.jpg.meta +1 -0
  402. data/test/dummy/system/files/test/2011/09/09/23_31_36_338_eos_550d_wrong_orientation.jpg +0 -0
  403. data/test/dummy/system/files/test/2011/09/09/23_31_36_338_eos_550d_wrong_orientation.jpg.meta +1 -0
  404. data/test/dummy/system/files/test/2011/09/09/23_31_53_958_eos_550d_wrong_orientation.jpg +0 -0
  405. data/test/dummy/system/files/test/2011/09/09/23_31_53_958_eos_550d_wrong_orientation.jpg.meta +1 -0
  406. data/test/dummy/system/files/test/2011/09/09/23_32_14_603_eos_550d_wrong_orientation.jpg +0 -0
  407. data/test/dummy/system/files/test/2011/09/09/23_32_14_603_eos_550d_wrong_orientation.jpg.meta +1 -0
  408. data/test/dummy/system/files/test/2011/09/09/23_32_15_116_some_text.txt +99 -0
  409. data/test/dummy/system/files/test/2011/09/09/23_32_15_116_some_text.txt.meta +1 -0
  410. data/test/dummy/system/files/test/2011/09/09/23_32_17_756_eos_550d_wrong_orientation.jpg +0 -0
  411. data/test/dummy/system/files/test/2011/09/09/23_32_17_756_eos_550d_wrong_orientation.jpg.meta +1 -0
  412. data/test/dummy/system/files/test/2011/09/09/23_32_44_535_eos_550d_wrong_orientation.jpg +0 -0
  413. data/test/dummy/system/files/test/2011/09/09/23_32_44_535_eos_550d_wrong_orientation.jpg.meta +1 -0
  414. data/test/dummy/system/files/test/2011/09/09/23_32_45_43_some_text.txt +99 -0
  415. data/test/dummy/system/files/test/2011/09/09/23_32_45_43_some_text.txt.meta +1 -0
  416. data/test/dummy/system/files/test/2011/09/09/23_32_47_451_eos_550d_wrong_orientation.jpg +0 -0
  417. data/test/dummy/system/files/test/2011/09/09/23_32_47_451_eos_550d_wrong_orientation.jpg.meta +1 -0
  418. data/test/dummy/system/files/test/2011/09/09/23_34_18_577_eos_550d_wrong_orientation.jpg +0 -0
  419. data/test/dummy/system/files/test/2011/09/09/23_34_18_577_eos_550d_wrong_orientation.jpg.meta +1 -0
  420. data/test/dummy/system/files/test/2011/09/09/23_34_19_85_some_text.txt +99 -0
  421. data/test/dummy/system/files/test/2011/09/09/23_34_19_85_some_text.txt.meta +1 -0
  422. data/test/dummy/system/files/test/2011/09/09/23_34_21_427_eos_550d_wrong_orientation.jpg +0 -0
  423. data/test/dummy/system/files/test/2011/09/09/23_34_21_427_eos_550d_wrong_orientation.jpg.meta +1 -0
  424. data/test/dummy/tmp/cache/assets/C54/230/sprockets%2F63597bd80af49501176a9c782c200818 +0 -0
  425. data/test/dummy/tmp/cache/assets/C8D/360/sprockets%2Fdf973572c645d2fd119001cd69374479 +0 -0
  426. data/test/dummy/tmp/cache/assets/C8E/040/sprockets%2F15dc6807595ff22a754893ef2d042944 +0 -0
  427. data/test/dummy/tmp/cache/assets/C9D/CF0/sprockets%2F07211d85a30e8ca544d28a82e11722c5 +0 -0
  428. data/test/dummy/tmp/cache/assets/CAA/1E0/sprockets%2Ff830741354b667e407d800e3b444f4bb +0 -0
  429. data/test/dummy/tmp/cache/assets/CAF/EB0/sprockets%2F6611c947ce02d3a22d579ce305f65662 +0 -0
  430. data/test/dummy/tmp/cache/assets/CB0/050/sprockets%2F82ee10d29ecf30a522699c686301761d +0 -0
  431. data/test/dummy/tmp/cache/assets/CB9/690/sprockets%2F2a8597c2f8571ae6ea34692d2019a495 +0 -0
  432. data/test/dummy/tmp/cache/assets/CE4/CB0/sprockets%2F3d466de255c44c4d526a6526ee267f42 +0 -0
  433. data/test/dummy/tmp/cache/assets/CED/3A0/sprockets%2F5598ef34994d21041804d8edaae45e75 +0 -0
  434. data/test/dummy/tmp/cache/assets/CFA/BB0/sprockets%2F036d173be5c5a8d610b011b0b79a47e5 +0 -0
  435. data/test/dummy/tmp/cache/assets/D02/E40/sprockets%2F23c3c1b9508b3ee3e213e6b15442cd86 +0 -0
  436. data/test/dummy/tmp/cache/assets/D0A/2A0/sprockets%2F404be3db0a559b6e46a9750d2930ca78 +0 -0
  437. data/test/dummy/tmp/cache/assets/D0F/940/sprockets%2Fe5a0c84816880ab73280e1d7c6c6b53f +0 -0
  438. data/test/dummy/tmp/cache/assets/D17/AD0/sprockets%2F40edf5645d2ef4837a7eb197d4274f11 +0 -0
  439. data/test/dummy/tmp/cache/assets/D19/7A0/sprockets%2F16629122405a5bb931a1aac5fd0c0c1c +0 -0
  440. data/test/dummy/tmp/cache/assets/D1B/850/sprockets%2F8ee0f24d6d9178d919763c720a26ea4d +0 -0
  441. data/test/dummy/tmp/cache/assets/D21/FC0/sprockets%2F42e26797aacaf09d1d8f399737d4862a +0 -0
  442. data/test/dummy/tmp/cache/assets/D22/400/sprockets%2F9fe3b745fe9b3671c7b7776067411fbd +0 -0
  443. data/test/dummy/tmp/cache/assets/D28/B20/sprockets%2F882bf161cb1bae439b071e92c023ca24 +0 -0
  444. data/test/dummy/tmp/cache/assets/D2B/B20/sprockets%2F8a8e489c909c9b7e4883ad91ae05819b +0 -0
  445. data/test/dummy/tmp/cache/assets/D39/7D0/sprockets%2F2d36d5c71bbb85e617c7aa5526db7711 +0 -0
  446. data/test/dummy/tmp/cache/assets/D45/980/sprockets%2F7b83a99c7ef5081e54dd817ee22e21c0 +0 -0
  447. data/test/dummy/tmp/cache/assets/D83/790/sprockets%2Fa54dd2e601bc260dba6d124f0e41ea48 +0 -0
  448. data/test/dummy/tmp/cache/assets/D88/F10/sprockets%2F8e8aacf9bb943215da36e48de57898b8 +0 -0
  449. data/test/dummy/tmp/cache/assets/D96/130/sprockets%2Fca2892c5774fcef0d04e4a5ab238a81b +0 -0
  450. data/test/dummy/tmp/cache/assets/D96/3B0/sprockets%2F55021ed83e62225daa5e5f7d63cdd0fc +0 -0
  451. data/test/dummy/tmp/cache/assets/D97/140/sprockets%2F894bacf9ace6c46e1b70610f2e12ac56 +0 -0
  452. data/test/dummy/tmp/cache/assets/DA2/050/sprockets%2F571a6834d9cabb59da17f83431ca9feb +0 -0
  453. data/test/dummy/tmp/cache/assets/DA4/B00/sprockets%2Fc3e3f4d5bea91c516b9e779a37651bbd +0 -0
  454. data/test/dummy/tmp/cache/assets/DA9/040/sprockets%2F840de459a6d1c9d87c8dcaf24f128b6c +0 -0
  455. data/test/dummy/tmp/cache/assets/DAB/540/sprockets%2Fb0518afe456f5094d8d9ade32edb985c +0 -0
  456. data/test/dummy/tmp/cache/assets/DC6/6B0/sprockets%2Fd36a94dae97de924ca11bcbb4f8a5006 +0 -0
  457. data/test/dummy/tmp/cache/assets/DD0/B50/sprockets%2F965cf49b0f4bc5a87e7d090aaf331aef +0 -0
  458. data/test/dummy/tmp/cache/assets/DD7/4A0/sprockets%2Fe5ef864e860eb0a95b4ac71cf239ffb4 +0 -0
  459. data/test/dummy/tmp/cache/assets/DFC/F40/sprockets%2F3c2e88bc8ee7e3afa6d790aec3f5b002 +0 -0
  460. data/test/dummy/tmp/cache/assets/DFC/FF0/sprockets%2F85ad0478ccaf1ce1fef2eec948a7006a +0 -0
  461. data/test/dummy/tmp/cache/assets/E6A/4B0/sprockets%2Fdea814b3f9e9bd154ee99ba09cfbfa5f +0 -0
  462. data/test/dummy/tmp/cache/assets/E74/190/sprockets%2F526cff6ffea7b75df9e3a7af389dafd2 +0 -0
  463. data/test/dummy/tmp/capybara/capybara-201109092320006678745731.html +95 -0
  464. data/test/dummy/tmp/capybara/capybara-201109092325048314739499.html +99 -0
  465. data/test/dummy/tmp/capybara/capybara-20110909232507494703749.html +99 -0
  466. data/test/dummy/tmp/capybara/capybara-201109092328469796695478.html +99 -0
  467. data/test/dummy/tmp/capybara/capybara-201109092330138915517817.html +99 -0
  468. data/test/dummy/tmp/capybara/capybara-201109092331366763771582.html +99 -0
  469. data/test/dummy/tmp/capybara/capybara-201109092331548655392084.html +99 -0
  470. data/test/dummy/tmp/capybara/capybara-201109092332183152685029.html +99 -0
  471. data/test/dummy/tmp/dragonfly/cache/body/02/721c6446a47a896dcec5814dde7fd642009ae4 +0 -0
  472. data/test/dummy/tmp/dragonfly/cache/body/08/0c26e7aee40c06f9d2cf2bbe66bb1b31f77eb6 +0 -0
  473. data/test/dummy/tmp/dragonfly/cache/body/08/254fdaeeef68ac1bd4e068bae4d538183f2418 +0 -0
  474. data/test/dummy/tmp/dragonfly/cache/body/0b/5fe01203ea843d9ce57ec076deba6686b972fc +0 -0
  475. data/test/dummy/tmp/dragonfly/cache/body/0d/ac97f509a0f1cc5bd06b74aa5a48de830c0211 +0 -0
  476. data/test/dummy/tmp/dragonfly/cache/body/0e/812da5582b69e917955b2f7548581a84b6cd6a +0 -0
  477. data/test/dummy/tmp/dragonfly/cache/body/12/dd55c3e1f837ed47c0bff8904f3eb356b5b0f6 +0 -0
  478. data/test/dummy/tmp/dragonfly/cache/body/15/c89387f2201547a650980eb83f5b00c0d4897d +0 -0
  479. data/test/dummy/tmp/dragonfly/cache/body/17/c372678aafb3bc1a7b37320b5cc1d8af433527 +0 -0
  480. data/test/dummy/tmp/dragonfly/cache/body/20/5f96aaf607592c0264d2d558debe2441db491f +67 -0
  481. data/test/dummy/tmp/dragonfly/cache/body/21/385143a7b417457e3fd0238114f9e905ab6a1d +0 -0
  482. data/test/dummy/tmp/dragonfly/cache/body/21/7f07b85f1d6096748b9e5b22c02319a4b8f390 +0 -0
  483. data/test/dummy/tmp/dragonfly/cache/body/23/0920237f649e2d5ad0882e5764d8548e9b3487 +0 -0
  484. data/test/dummy/tmp/dragonfly/cache/body/2f/8a4437d9ee577f23ccfa627b9eb3d7ff124276 +0 -0
  485. data/test/dummy/tmp/dragonfly/cache/body/2f/a601f43d7a7e7d9cb27727aa09c7c2ebf9dc99 +0 -0
  486. data/test/dummy/tmp/dragonfly/cache/body/3b/e4db5a0b83943d135fc5db57eb36c18620cdf4 +0 -0
  487. data/test/dummy/tmp/dragonfly/cache/body/3c/68fcd55940690f91d27c2d58669f8f820b0c54 +0 -0
  488. data/test/dummy/tmp/dragonfly/cache/body/41/e0112505525d15bdf882ef9225211561708253 +0 -0
  489. data/test/dummy/tmp/dragonfly/cache/body/42/827ecc71792a78d6c397ae60ef8f97286fbc82 +0 -0
  490. data/test/dummy/tmp/dragonfly/cache/body/46/d0d3f03762081530c375e7ef050708cc68cb7a +678 -0
  491. data/test/dummy/tmp/dragonfly/cache/body/4d/2dae957d0bb81139b39d955786e323ee055329 +0 -0
  492. data/test/dummy/tmp/dragonfly/cache/body/51/8ea4e56f01048ac2f8215e2ecdacc87fbcba3c +0 -0
  493. data/test/dummy/tmp/dragonfly/cache/body/57/39c3e8b2f1ee70719aecb8ef70df4b9e7aa30f +0 -0
  494. data/test/dummy/tmp/dragonfly/cache/body/5b/46eb669828b8a68c8acd6fc2db2eef49977ae9 +0 -0
  495. data/test/dummy/tmp/dragonfly/cache/body/5c/4f1da1404a7bb1a92c09651a8cebb689dd2794 +0 -0
  496. data/test/dummy/tmp/dragonfly/cache/body/5d/6c12803af858f267909373dcbfd0044c29329f +0 -0
  497. data/test/dummy/tmp/dragonfly/cache/body/60/7b9096192366c7dfda7b5272da2b29e9055832 +0 -0
  498. data/test/dummy/tmp/dragonfly/cache/body/61/8583b3fa87320abc5f5301128bd8dc4887ae6d +0 -0
  499. data/test/dummy/tmp/dragonfly/cache/body/65/fed3e34b83d067d408908450b99f92886a1169 +0 -0
  500. data/test/dummy/tmp/dragonfly/cache/body/67/59cadb44cd9fcf1826f884746f799b6de1dc6f +1601 -0
  501. data/test/dummy/tmp/dragonfly/cache/body/69/2a04fcfdde8b993612ef0f3fc2702ede8d11cc +0 -0
  502. data/test/dummy/tmp/dragonfly/cache/body/6d/fb275b3e335748e2229ce486420446f5bd5850 +0 -0
  503. data/test/dummy/tmp/dragonfly/cache/body/71/d37560812963e391f4af2d4d8345af9ae92a75 +0 -0
  504. data/test/dummy/tmp/dragonfly/cache/body/72/5bc79d8cf7ee35f0d895d16be006b9cdccaa84 +0 -0
  505. data/test/dummy/tmp/dragonfly/cache/body/75/5fbdc9e158883976a91a81c5fb8e1a75a73db0 +124 -0
  506. data/test/dummy/tmp/dragonfly/cache/body/79/fa5c68d077a3878a1906b1ecb323d71b51c728 +0 -0
  507. data/test/dummy/tmp/dragonfly/cache/body/7b/df2ee1b3688998cc267d31b2d46db7d605dabb +36 -0
  508. data/test/dummy/tmp/dragonfly/cache/body/7c/72e4841fbc0214d562f5306ca03cf5360cbc41 +0 -0
  509. data/test/dummy/tmp/dragonfly/cache/body/7c/917486fde4f81cd3ef2e0214b127c99f0de028 +0 -0
  510. data/test/dummy/tmp/dragonfly/cache/body/81/15dce6dd36e132948846e70920cda88ab48193 +0 -0
  511. data/test/dummy/tmp/dragonfly/cache/body/85/a5c30dfd9be9f09412b7d4c24b050f8c6fa756 +0 -0
  512. data/test/dummy/tmp/dragonfly/cache/body/8a/b0f4219a7b2c19044a090115a45e76e43b268e +5 -0
  513. data/test/dummy/tmp/dragonfly/cache/body/8e/da1f981ced789b6a5cf38be3d0feb120371707 +5 -0
  514. data/test/dummy/tmp/dragonfly/cache/body/8f/5f17f48a805e82fd5b2121fc4778c07e942fa1 +0 -0
  515. data/test/dummy/tmp/dragonfly/cache/body/90/9eb8bdb06501dbdebdd18886291823626896db +0 -0
  516. data/test/dummy/tmp/dragonfly/cache/body/99/78272eaaac9cede9732d0259ba4346d15c8758 +0 -0
  517. data/test/dummy/tmp/dragonfly/cache/body/a1/9191b091ec5e351ab7d927af890252525e02af +0 -0
  518. data/test/dummy/tmp/dragonfly/cache/body/a2/5ea02e1fef7a8c1d868b5b6b90b220f77feec1 +0 -0
  519. data/test/dummy/tmp/dragonfly/cache/body/b2/44ae6f4a17abaf2edd0de1f9b6df0b726e519e +0 -0
  520. data/test/dummy/tmp/dragonfly/cache/body/c4/c117cf71769d9ff8ac43ada6987b1a5c28e7aa +0 -0
  521. data/test/dummy/tmp/dragonfly/cache/body/c7/19312be82da5b5863b7fa266ba7044c5e1a869 +0 -0
  522. data/test/dummy/tmp/dragonfly/cache/body/c7/9e06c42b18cb487bcbeb3dfa1cd6046bcec1ae +0 -0
  523. data/test/dummy/tmp/dragonfly/cache/body/d2/b8c4a040fdf477afee014b1025ddb4c9ac629b +0 -0
  524. data/test/dummy/tmp/dragonfly/cache/body/e0/70d032da00a71e9d13b4d176f44f0e8bb607fa +0 -0
  525. data/test/dummy/tmp/dragonfly/cache/body/e6/3fa52fe75043747175d92810dc6fc07055e599 +297 -0
  526. data/test/dummy/tmp/dragonfly/cache/body/e9/4a5c7b4e9b454754f59c1f99367b0ea2ee1065 +0 -0
  527. data/test/dummy/tmp/dragonfly/cache/body/f1/25e84ad3ce213a2c0818d443f37b9f0df2fec2 +0 -0
  528. data/test/dummy/tmp/dragonfly/cache/body/f5/bed1e84e45c5c74a29c42e9774b19d5980b694 +0 -0
  529. data/test/dummy/tmp/dragonfly/cache/body/f6/c8f7f60c3b65b6c78e36ddf236c9a90ef5f559 +0 -0
  530. data/test/dummy/tmp/dragonfly/cache/body/fa/3488e1c8533d4134d82b1c12370225c778e243 +0 -0
  531. data/test/dummy/tmp/dragonfly/cache/body/fb/629489200dc7864ba333386142de7aaeb42e14 +0 -0
  532. data/test/dummy/tmp/dragonfly/cache/body/fc/93e44494bc4b2a53ecf1d3e95aa2d8a01339ed +364 -0
  533. data/test/dummy/tmp/dragonfly/cache/body/ff/6a116d11d72ece8ee12df4222a8d050e621ced +0 -0
  534. data/test/dummy/tmp/dragonfly/cache/meta/01/3065619a0b9cae99580ddf0997720bffb1717a +0 -0
  535. data/test/dummy/tmp/dragonfly/cache/meta/04/af50d9817350da61d8ba5aea57ee5da612ab87 +0 -0
  536. data/test/dummy/tmp/dragonfly/cache/meta/0a/0cf0e35f173a394675f32be7c45ac2d055eb23 +0 -0
  537. data/test/dummy/tmp/dragonfly/cache/meta/0c/2966accbe048d462250fc2fb02dccf56c5753e +0 -0
  538. data/test/dummy/tmp/dragonfly/cache/meta/0d/1264278b6c78096e10e85c9ab6be94b2911da0 +0 -0
  539. data/test/dummy/tmp/dragonfly/cache/meta/0d/7c4648195ab8e0c30c41a49728ce2a96e15c6c +0 -0
  540. data/test/dummy/tmp/dragonfly/cache/meta/10/96b90ee1bcd363fd72c4d7f2fbd9e28042945e +0 -0
  541. data/test/dummy/tmp/dragonfly/cache/meta/12/3fc380689a07b29b77a4576c50f23a763c5e6b +0 -0
  542. data/test/dummy/tmp/dragonfly/cache/meta/18/070a70152465eee702884a4680efcb8ca2c4d8 +0 -0
  543. data/test/dummy/tmp/dragonfly/cache/meta/18/18005c396885d43a6d4bf39c5296e348b36a9f +0 -0
  544. data/test/dummy/tmp/dragonfly/cache/meta/19/f4bd3e5c66e2ff01ff1aacc51c82286850b9fd +0 -0
  545. data/test/dummy/tmp/dragonfly/cache/meta/1a/4f7e6c2c0139daf7220048e9acacca2260a9b5 +0 -0
  546. data/test/dummy/tmp/dragonfly/cache/meta/1a/efd420f6e3607d2d8d1ba81945bdd9d2a6059b +0 -0
  547. data/test/dummy/tmp/dragonfly/cache/meta/24/d0aebc1b6d4ac3b10caa6cfabf89b0ad8551c5 +0 -0
  548. data/test/dummy/tmp/dragonfly/cache/meta/25/13e224314708bfd6611c302dc5bdd254e1d143 +0 -0
  549. data/test/dummy/tmp/dragonfly/cache/meta/26/3291d6e1fff88a6fcea7c8abbe388feb247ba5 +0 -0
  550. data/test/dummy/tmp/dragonfly/cache/meta/29/2120cfb4b63f2b0d62e4d7da4c6c21ef25be6d +0 -0
  551. data/test/dummy/tmp/dragonfly/cache/meta/2b/0533453bd6f48c8273665ce90f2504c7953433 +0 -0
  552. data/test/dummy/tmp/dragonfly/cache/meta/2c/e93382e836abdfc7fa2cd878a853a2352c6863 +0 -0
  553. data/test/dummy/tmp/dragonfly/cache/meta/30/5fcc7f5f20cb4116ec776b1e0c84ad4124b7e3 +0 -0
  554. data/test/dummy/tmp/dragonfly/cache/meta/30/d631e3e7e76fb306572de037e3e22dac7c90b5 +0 -0
  555. data/test/dummy/tmp/dragonfly/cache/meta/32/bb0d86dce0954ce828e63fb229367150f8a348 +0 -0
  556. data/test/dummy/tmp/dragonfly/cache/meta/33/36e8fbaec28f1307731923edfeb217e779883d +0 -0
  557. data/test/dummy/tmp/dragonfly/cache/meta/34/4b8d55869a4bd3edab571ea25d5a60be74a4ad +0 -0
  558. data/test/dummy/tmp/dragonfly/cache/meta/36/059c3f0d7f64947c8e8655bc259d0d22c6f0ae +0 -0
  559. data/test/dummy/tmp/dragonfly/cache/meta/36/05f012ee4184f83178a9d9624f82da39535afa +0 -0
  560. data/test/dummy/tmp/dragonfly/cache/meta/37/fb962d39887389e020d58ef1f745ef1a6107cc +0 -0
  561. data/test/dummy/tmp/dragonfly/cache/meta/3b/856fc9f19a6d9e6a71bce9a841da7ee782fc4d +0 -0
  562. data/test/dummy/tmp/dragonfly/cache/meta/3c/0727fc9dc75105ed5db9c67c8dec217c00890e +0 -0
  563. data/test/dummy/tmp/dragonfly/cache/meta/40/c25475cb587c48d080dba999ad01f3680760a0 +0 -0
  564. data/test/dummy/tmp/dragonfly/cache/meta/42/248da9860a2fcefea309334de75486a4619e31 +0 -0
  565. data/test/dummy/tmp/dragonfly/cache/meta/4d/f57798fd4469ad3dc138784597a0786ae7485d +0 -0
  566. data/test/dummy/tmp/dragonfly/cache/meta/51/b3b7831b3925e105bbfa44907df3003b676d69 +0 -0
  567. data/test/dummy/tmp/dragonfly/cache/meta/52/bf5a4fdf49c8f85dfa21077c8aec7595166ff7 +0 -0
  568. data/test/dummy/tmp/dragonfly/cache/meta/53/f1cfc0b3a0db2005a893d1b4792cfebd02a496 +0 -0
  569. data/test/dummy/tmp/dragonfly/cache/meta/54/8f3e2400cdf954f37f3458f6848df0a2e757ad +0 -0
  570. data/test/dummy/tmp/dragonfly/cache/meta/55/30dc20e78a80eee7be7b3c2e7fb9a6240596db +0 -0
  571. data/test/dummy/tmp/dragonfly/cache/meta/55/38528ae65e63542e11cb67d3c08b540a9b2d94 +0 -0
  572. data/test/dummy/tmp/dragonfly/cache/meta/5a/004ae0e2810be18892a3b3ff3d73c5b25ad3f4 +0 -0
  573. data/test/dummy/tmp/dragonfly/cache/meta/5a/f69fd22127b74a43f6de78a7d76f53b9c04a02 +0 -0
  574. data/test/dummy/tmp/dragonfly/cache/meta/5b/9a5982c77d59446fa2c789a2e7b6cd3895d753 +0 -0
  575. data/test/dummy/tmp/dragonfly/cache/meta/60/af267c39b09e11ff7d7bfc727d48ca0e107afd +0 -0
  576. data/test/dummy/tmp/dragonfly/cache/meta/62/a94c517cd458c99ce0f00fbca345b386791cfc +0 -0
  577. data/test/dummy/tmp/dragonfly/cache/meta/63/4fbf95f978eb0e7ee339e28306bc9c6f106aa6 +0 -0
  578. data/test/dummy/tmp/dragonfly/cache/meta/63/e389869e5c2ae071a4ccd8474de105688917ef +0 -0
  579. data/test/dummy/tmp/dragonfly/cache/meta/65/c109299780f8c24cc265b8cf0c008b2695b2d0 +0 -0
  580. data/test/dummy/tmp/dragonfly/cache/meta/67/3a6ed8453f75e7560051d0764e25985fbc73f6 +0 -0
  581. data/test/dummy/tmp/dragonfly/cache/meta/69/e529e365a42911c19be24956d4d69ea6549a1e +0 -0
  582. data/test/dummy/tmp/dragonfly/cache/meta/6a/20921464b13433185c30ffadb364e222ae7ed6 +0 -0
  583. data/test/dummy/tmp/dragonfly/cache/meta/6a/6fef8f2fee7684b6aa79ffc874c801a6439cf7 +0 -0
  584. data/test/dummy/tmp/dragonfly/cache/meta/6b/4cb5999dbf269f63e8a0d90ac47e0fdcd7a7fc +0 -0
  585. data/test/dummy/tmp/dragonfly/cache/meta/6b/b67017491eefcfe9e77a3318c50537f58e08d0 +0 -0
  586. data/test/dummy/tmp/dragonfly/cache/meta/6d/09f8911bc33c26c3e29e5a65a201c963bdbc6d +0 -0
  587. data/test/dummy/tmp/dragonfly/cache/meta/6d/52b2b6a302149bbd91303f96d7b6ffdbca4e74 +0 -0
  588. data/test/dummy/tmp/dragonfly/cache/meta/6d/ee29e8ca14075ad948b8b4d6c72fa091c6da46 +0 -0
  589. data/test/dummy/tmp/dragonfly/cache/meta/6e/83d3a60fc229b04e7403d7131aa4814a4200ec +0 -0
  590. data/test/dummy/tmp/dragonfly/cache/meta/77/38b3417940cf16c3f3ad22f4700966ecd65d5f +0 -0
  591. data/test/dummy/tmp/dragonfly/cache/meta/78/91eda6ab044d75d3672900d2483a3faf1c514a +0 -0
  592. data/test/dummy/tmp/dragonfly/cache/meta/78/da9e9f151eb605b427b43e2098640de3fd4a6d +0 -0
  593. data/test/dummy/tmp/dragonfly/cache/meta/79/6c237ed7355682d77a2bdc75b729b63c3b35da +0 -0
  594. data/test/dummy/tmp/dragonfly/cache/meta/79/a367ab7493c1a7a7e877ff281fb6eed266293b +0 -0
  595. data/test/dummy/tmp/dragonfly/cache/meta/7a/e20b7ceaffa5ebb57b658f4d6a54434c0301f3 +0 -0
  596. data/test/dummy/tmp/dragonfly/cache/meta/81/f24ab09d96a0d40ab560a90e955c4a312aa16c +0 -0
  597. data/test/dummy/tmp/dragonfly/cache/meta/82/1a8db33dc013c9ed726ddf43544ff80cf5774f +0 -0
  598. data/test/dummy/tmp/dragonfly/cache/meta/83/c9e02a4d1e0fbec1698938386445e771abc2d5 +0 -0
  599. data/test/dummy/tmp/dragonfly/cache/meta/83/fa85e2058741d72b66a98cf71819794d7525d3 +0 -0
  600. data/test/dummy/tmp/dragonfly/cache/meta/8a/00f63a175cfe09352e9103621040457aafc9e8 +0 -0
  601. data/test/dummy/tmp/dragonfly/cache/meta/8a/be19ee1009445886ab915e98aaf4439dfea49e +0 -0
  602. data/test/dummy/tmp/dragonfly/cache/meta/8e/284814afc3b0022e3160614cbaa3d86f13b460 +0 -0
  603. data/test/dummy/tmp/dragonfly/cache/meta/90/8a5565b2a739ca74f478c627a420fed85e6c6c +0 -0
  604. data/test/dummy/tmp/dragonfly/cache/meta/91/5796a36ec9ee121e91397217a67a94ea6da1fa +0 -0
  605. data/test/dummy/tmp/dragonfly/cache/meta/98/ea755ff6eec2e9301261741fb2c6deacdbad55 +0 -0
  606. data/test/dummy/tmp/dragonfly/cache/meta/9c/1d73b13f2c881eb18ebbd543b4cf6cc68d6084 +0 -0
  607. data/test/dummy/tmp/dragonfly/cache/meta/9c/3654a4968510a1697953936517c0b51f2c88f7 +0 -0
  608. data/test/dummy/tmp/dragonfly/cache/meta/9c/ffa966404611fb6408a5b9c3d98b1d3ec2ade8 +0 -0
  609. data/test/dummy/tmp/dragonfly/cache/meta/9f/048ae8a78d8f4f5bbeffc9e4fe44547d30a3c3 +0 -0
  610. data/test/dummy/tmp/dragonfly/cache/meta/9f/0b98933058db40fd34385876c49d9815ccecef +0 -0
  611. data/test/dummy/tmp/dragonfly/cache/meta/9f/341ebba7f7eaeb03f608874c62f75b048c1450 +0 -0
  612. data/test/dummy/tmp/dragonfly/cache/meta/a0/95aca06b094735d07d35954bdee7ed7cfe0554 +0 -0
  613. data/test/dummy/tmp/dragonfly/cache/meta/a5/c23ac345316a47a28625f346ec288f4ffe833b +0 -0
  614. data/test/dummy/tmp/dragonfly/cache/meta/a6/4588ad53212e92bbaf0b54de604e7e7fa5b4db +0 -0
  615. data/test/dummy/tmp/dragonfly/cache/meta/a6/6070c84b51514a4b0df87efe9f45eeb73bb6ac +0 -0
  616. data/test/dummy/tmp/dragonfly/cache/meta/a8/0db0a6a24608ae624628d08f44d70c95649269 +0 -0
  617. data/test/dummy/tmp/dragonfly/cache/meta/aa/0edadeee0f51930b22f81d18d890eeb42d5401 +0 -0
  618. data/test/dummy/tmp/dragonfly/cache/meta/ab/26841be4fe66f5073bf80165818018b960a8ae +0 -0
  619. data/test/dummy/tmp/dragonfly/cache/meta/ab/ab380d458496ff33fa5595160d6af7f6937ab4 +0 -0
  620. data/test/dummy/tmp/dragonfly/cache/meta/ac/e54f85800ea849425abf55b913780cd24c17b5 +0 -0
  621. data/test/dummy/tmp/dragonfly/cache/meta/ac/efd266978924a9ae28e46abdc18da5cc570556 +0 -0
  622. data/test/dummy/tmp/dragonfly/cache/meta/ad/081a80bb92be111e886cead55d04302d7ecc5d +0 -0
  623. data/test/dummy/tmp/dragonfly/cache/meta/b0/1dfc84881b36982e7459fc7aceb0ed0436eb21 +0 -0
  624. data/test/dummy/tmp/dragonfly/cache/meta/b0/476d0611c67ca7e646fe9008027d2f7bb8fcc5 +0 -0
  625. data/test/dummy/tmp/dragonfly/cache/meta/b2/b5d99458d046e39c53e7989d1eca2213062c4a +0 -0
  626. data/test/dummy/tmp/dragonfly/cache/meta/b6/ebbc22d1d6daf6e8cc040dc390dbdac883b75e +0 -0
  627. data/test/dummy/tmp/dragonfly/cache/meta/b8/a226d376b7ee94ade1cc2b9a043b1dea49339e +0 -0
  628. data/test/dummy/tmp/dragonfly/cache/meta/ba/d54f2cb0ea7effe26fb522981c85f6fac64f32 +0 -0
  629. data/test/dummy/tmp/dragonfly/cache/meta/c5/5ead58e8a96964f7fb901faacb189e897cb007 +0 -0
  630. data/test/dummy/tmp/dragonfly/cache/meta/c6/fd4d90e43a76b3740851a8c80cf293307d2ea3 +0 -0
  631. data/test/dummy/tmp/dragonfly/cache/meta/c7/765e66244779358dccb3e201ee971393d84d78 +0 -0
  632. data/test/dummy/tmp/dragonfly/cache/meta/d1/a729f56a6d9af0910d9d1cf4acbbe2ef23cf56 +0 -0
  633. data/test/dummy/tmp/dragonfly/cache/meta/d3/4e9f7374955f09514d9a9fc8930a6cbce53b75 +0 -0
  634. data/test/dummy/tmp/dragonfly/cache/meta/d6/f1bee9080d9c2926b3ade281a8f1a0f9be79cd +0 -0
  635. data/test/dummy/tmp/dragonfly/cache/meta/d8/705b3496156d15650a193d89e485da0a2d15c6 +0 -0
  636. data/test/dummy/tmp/dragonfly/cache/meta/dc/d63af225e5131ef6464cbfc87e20dc63a44365 +0 -0
  637. data/test/dummy/tmp/dragonfly/cache/meta/dd/46c780a1284b0a84e1585fcaaec88729229a36 +0 -0
  638. data/test/dummy/tmp/dragonfly/cache/meta/e1/979d7cb9c431766cbafda1b1245cce7ea4f134 +0 -0
  639. data/test/dummy/tmp/dragonfly/cache/meta/e2/eab333969d7051831d38e5ba719e8887f4aca3 +0 -0
  640. data/test/dummy/tmp/dragonfly/cache/meta/e3/7b192c0fa3f14120b61ba43591b4e0148decc2 +0 -0
  641. data/test/dummy/tmp/dragonfly/cache/meta/e4/753c26eac3624a8f0906a4610eb9639e9f1238 +0 -0
  642. data/test/dummy/tmp/dragonfly/cache/meta/e4/8b49afae3e511dee8a480c0699f57af166c476 +0 -0
  643. data/test/dummy/tmp/dragonfly/cache/meta/e4/a4a5574b655ab7a23ac8ea6996ce6026cba172 +0 -0
  644. data/test/dummy/tmp/dragonfly/cache/meta/e6/5be6e8db6390a762521141e190fd51cb900510 +0 -0
  645. data/test/dummy/tmp/dragonfly/cache/meta/e8/018099d6dec59462ad5b4ff834a40769811c4b +0 -0
  646. data/test/dummy/tmp/dragonfly/cache/meta/ec/95bd937fde5971c9757707875459afd5ee969b +0 -0
  647. data/test/dummy/tmp/dragonfly/cache/meta/ed/164629434f41289c45072ffffd69ec4bcfbfdb +0 -0
  648. data/test/dummy/tmp/dragonfly/cache/meta/ed/452ae956d56d97238744889483dc28e05b4049 +0 -0
  649. data/test/dummy/tmp/dragonfly/cache/meta/ee/b10ca471bf747caae6ec43dd51134d4a4a1d35 +0 -0
  650. data/test/dummy/tmp/dragonfly/cache/meta/ee/bd50d392c542daa5b2e5a84bea9b061884dd50 +0 -0
  651. data/test/dummy/tmp/dragonfly/cache/meta/ee/fe74949a8c2a0bbc077385a12944d9f98a12e0 +0 -0
  652. data/test/dummy/tmp/dragonfly/cache/meta/ef/c1a278bfae61838492c518085077e090847928 +0 -0
  653. data/test/dummy/tmp/dragonfly/cache/meta/f1/44fd03870ca4a56ae2ed5eea541d2b16a331ed +0 -0
  654. data/test/dummy/tmp/dragonfly/cache/meta/f2/52c824b170bae8cac2db80a1bac032f2dcebcc +0 -0
  655. data/test/dummy/tmp/dragonfly/cache/meta/f6/3c95e93a23255c015b61e3ec1c8c0a943bb27f +0 -0
  656. data/test/dummy/tmp/dragonfly/cache/meta/f7/d62984c9d390ea3d5891ecbe2788626bc3c599 +0 -0
  657. data/test/dummy/tmp/dragonfly/cache/meta/f7/dc16bbb163aac4e7da0cbd6136bdf0401e732c +0 -0
  658. data/test/dummy/tmp/dragonfly/cache/meta/f9/67ac04386c59253bd80f4034d18af166cc5691 +0 -0
  659. data/test/fixtures/saphira/image_variants.yml +11 -0
  660. data/test/functional/saphira/image_variant_settings_controller_test.rb +21 -0
  661. data/test/functional/saphira/image_variants_controller_test.rb +51 -0
  662. data/test/unit/helpers/saphira/image_variant_settings_helper_test.rb +6 -0
  663. data/test/unit/helpers/saphira/image_variants_helper_test.rb +6 -0
  664. data/test/unit/saphira/image_variant_test.rb +9 -0
  665. metadata +1212 -25
@@ -0,0 +1,2466 @@
1
+ /*
2
+ Copyright (c) 2008, Adobe Systems Incorporated
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are
7
+ met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice,
10
+ this list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright
13
+ notice, this list of conditions and the following disclaimer in the
14
+ documentation and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of Adobe Systems Incorporated nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
+ */
32
+
33
+ package com.adobe.net
34
+ {
35
+ import flash.utils.ByteArray;
36
+
37
+ /**
38
+ * This class implements functions and utilities for working with URI's
39
+ * (Universal Resource Identifiers). For technical description of the
40
+ * URI syntax, please see RFC 3986 at http://www.ietf.org/rfc/rfc3986.txt
41
+ * or do a web search for "rfc 3986".
42
+ *
43
+ * <p>The most important aspect of URI's to understand is that URI's
44
+ * and URL's are not strings. URI's are complex data structures that
45
+ * encapsulate many pieces of information. The string version of a
46
+ * URI is the serialized representation of that data structure. This
47
+ * string serialization is used to provide a human readable
48
+ * representation and a means to transport the data over the network
49
+ * where it can then be parsed back into its' component parts.</p>
50
+ *
51
+ * <p>URI's fall into one of three categories:
52
+ * <ul>
53
+ * <li>&lt;scheme&gt;:&lt;scheme-specific-part&gt;#&lt;fragment&gt; (non-hierarchical)</li>
54
+ * <li>&lt;scheme&gt;:<authority&gt;&lt;path&gt;?&lt;query&gt;#&lt;fragment&gt; (hierarchical)</li>
55
+ * <li>&lt;path&gt;?&lt;query&gt;#&lt;fragment&gt; (relative hierarchical)</li>
56
+ * </ul></p>
57
+ *
58
+ * <p>The query and fragment parts are optional.</p>
59
+ *
60
+ * <p>This class supports both non-hierarchical and hierarchical URI's</p>
61
+ *
62
+ * <p>This class is intended to be used "as-is" for the vast majority
63
+ * of common URI's. However, if your application requires a custom
64
+ * URI syntax (e.g. custom query syntax or special handling of
65
+ * non-hierarchical URI's), this class can be fully subclassed. If you
66
+ * intended to subclass URI, please see the source code for complete
67
+ * documation on protected members and protected fuctions.</p>
68
+ *
69
+ * @langversion ActionScript 3.0
70
+ * @playerversion Flash 9.0
71
+ */
72
+ public class URI
73
+ {
74
+ // Here we define which characters must be escaped for each
75
+ // URI part. The characters that must be escaped for each
76
+ // part differ depending on what would cause ambiguous parsing.
77
+ // RFC 3986 sec. 2.4 states that characters should only be
78
+ // encoded when they would conflict with subcomponent delimiters.
79
+ // We don't want to over-do the escaping. We only want to escape
80
+ // the minimum needed to prevent parsing problems.
81
+
82
+ // space and % must be escaped in all cases. '%' is the delimiter
83
+ // for escaped characters.
84
+ public static const URImustEscape:String = " %";
85
+
86
+ // Baseline of what characters must be escaped
87
+ public static const URIbaselineEscape:String = URImustEscape + ":?#/@";
88
+
89
+ // Characters that must be escaped in the part part.
90
+ public static const URIpathEscape:String = URImustEscape + "?#";
91
+
92
+ // Characters that must be escaped in the query part, if setting
93
+ // the query as a whole string. If the query is set by
94
+ // name/value, URIqueryPartEscape is used instead.
95
+ public static const URIqueryEscape:String = URImustEscape + "#";
96
+
97
+ // This is what each name/value pair must escape "&=" as well
98
+ // so they don't conflict with the "param=value&param2=value2"
99
+ // syntax.
100
+ public static const URIqueryPartEscape:String = URImustEscape + "#&=";
101
+
102
+ // Non-hierarchical URI's can have query and fragment parts, but
103
+ // we also want to prevent '/' otherwise it might end up looking
104
+ // like a hierarchical URI to the parser.
105
+ public static const URInonHierEscape:String = URImustEscape + "?#/";
106
+
107
+ // Baseline uninitialized setting for the URI scheme.
108
+ public static const UNKNOWN_SCHEME:String = "unknown";
109
+
110
+ // The following bitmaps are used for performance enhanced
111
+ // character escaping.
112
+
113
+ // Baseline characters that need to be escaped. Many parts use
114
+ // this.
115
+ protected static const URIbaselineExcludedBitmap:URIEncodingBitmap =
116
+ new URIEncodingBitmap(URIbaselineEscape);
117
+
118
+ // Scheme escaping bitmap
119
+ protected static const URIschemeExcludedBitmap:URIEncodingBitmap =
120
+ URIbaselineExcludedBitmap;
121
+
122
+ // User/pass escaping bitmap
123
+ protected static const URIuserpassExcludedBitmap:URIEncodingBitmap =
124
+ URIbaselineExcludedBitmap;
125
+
126
+ // Authority escaping bitmap
127
+ protected static const URIauthorityExcludedBitmap:URIEncodingBitmap =
128
+ URIbaselineExcludedBitmap;
129
+
130
+ // Port escaping bitmap
131
+ protected static const URIportExludedBitmap:URIEncodingBitmap =
132
+ URIbaselineExcludedBitmap;
133
+
134
+ // Path escaping bitmap
135
+ protected static const URIpathExcludedBitmap:URIEncodingBitmap =
136
+ new URIEncodingBitmap(URIpathEscape);
137
+
138
+ // Query (whole) escaping bitmap
139
+ protected static const URIqueryExcludedBitmap:URIEncodingBitmap =
140
+ new URIEncodingBitmap(URIqueryEscape);
141
+
142
+ // Query (individual parts) escaping bitmap
143
+ protected static const URIqueryPartExcludedBitmap:URIEncodingBitmap =
144
+ new URIEncodingBitmap(URIqueryPartEscape);
145
+
146
+ // Fragments are the last part in the URI. They only need to
147
+ // escape space, '#', and '%'. Turns out that is what query
148
+ // uses too.
149
+ protected static const URIfragmentExcludedBitmap:URIEncodingBitmap =
150
+ URIqueryExcludedBitmap;
151
+
152
+ // Characters that need to be escaped in the non-hierarchical part
153
+ protected static const URInonHierexcludedBitmap:URIEncodingBitmap =
154
+ new URIEncodingBitmap(URInonHierEscape);
155
+
156
+ // Values used by getRelation()
157
+ public static const NOT_RELATED:int = 0;
158
+ public static const CHILD:int = 1;
159
+ public static const EQUAL:int = 2;
160
+ public static const PARENT:int = 3;
161
+
162
+ //-------------------------------------------------------------------
163
+ // protected class members
164
+ //-------------------------------------------------------------------
165
+ protected var _valid:Boolean = false;
166
+ protected var _relative:Boolean = false;
167
+ protected var _scheme:String = "";
168
+ protected var _authority:String = "";
169
+ protected var _username:String = "";
170
+ protected var _password:String = "";
171
+ protected var _port:String = "";
172
+ protected var _path:String = "";
173
+ protected var _query:String = "";
174
+ protected var _fragment:String = "";
175
+ protected var _nonHierarchical:String = "";
176
+ protected static var _resolver:IURIResolver = null;
177
+
178
+
179
+ /**
180
+ * URI Constructor. If no string is given, this will initialize
181
+ * this URI object to a blank URI.
182
+ */
183
+ public function URI(uri:String = null) : void
184
+ {
185
+ if (uri == null)
186
+ initialize();
187
+ else
188
+ constructURI(uri);
189
+ }
190
+
191
+
192
+ /**
193
+ * @private
194
+ * Method that loads the URI from the given string.
195
+ */
196
+ protected function constructURI(uri:String) : Boolean
197
+ {
198
+ if (!parseURI(uri))
199
+ _valid = false;
200
+
201
+ return isValid();
202
+ }
203
+
204
+
205
+ /**
206
+ * @private Private initializiation.
207
+ */
208
+ protected function initialize() : void
209
+ {
210
+ _valid = false;
211
+ _relative = false;
212
+
213
+ _scheme = UNKNOWN_SCHEME;
214
+ _authority = "";
215
+ _username = "";
216
+ _password = "";
217
+ _port = "";
218
+ _path = "";
219
+ _query = "";
220
+ _fragment = "";
221
+
222
+ _nonHierarchical = "";
223
+ }
224
+
225
+ /**
226
+ * @private Accessor to explicitly set/get the hierarchical
227
+ * state of the URI.
228
+ */
229
+ protected function set hierState(state:Boolean) : void
230
+ {
231
+ if (state)
232
+ {
233
+ // Clear the non-hierarchical data
234
+ _nonHierarchical = "";
235
+
236
+ // Also set the state vars while we are at it
237
+ if (_scheme == "" || _scheme == UNKNOWN_SCHEME)
238
+ _relative = true;
239
+ else
240
+ _relative = false;
241
+
242
+ if (_authority.length == 0 && _path.length == 0)
243
+ _valid = false;
244
+ else
245
+ _valid = true;
246
+ }
247
+ else
248
+ {
249
+ // Clear the hierarchical data
250
+ _authority = "";
251
+ _username = "";
252
+ _password = "";
253
+ _port = "";
254
+ _path = "";
255
+
256
+ _relative = false;
257
+
258
+ if (_scheme == "" || _scheme == UNKNOWN_SCHEME)
259
+ _valid = false;
260
+ else
261
+ _valid = true;
262
+ }
263
+ }
264
+ protected function get hierState() : Boolean
265
+ {
266
+ return (_nonHierarchical.length == 0);
267
+ }
268
+
269
+
270
+ /**
271
+ * @private Functions that performs some basic consistency validation.
272
+ */
273
+ protected function validateURI() : Boolean
274
+ {
275
+ // Check the scheme
276
+ if (isAbsolute())
277
+ {
278
+ if (_scheme.length <= 1 || _scheme == UNKNOWN_SCHEME)
279
+ {
280
+ // we probably parsed a C:\ type path or no scheme
281
+ return false;
282
+ }
283
+ else if (verifyAlpha(_scheme) == false)
284
+ return false; // Scheme contains bad characters
285
+ }
286
+
287
+ if (hierState)
288
+ {
289
+ if (_path.search('\\') != -1)
290
+ return false; // local path
291
+ else if (isRelative() == false && _scheme == UNKNOWN_SCHEME)
292
+ return false; // It's an absolute URI, but it has a bad scheme
293
+ }
294
+ else
295
+ {
296
+ if (_nonHierarchical.search('\\') != -1)
297
+ return false; // some kind of local path
298
+ }
299
+
300
+ // Looks like it's ok.
301
+ return true;
302
+ }
303
+
304
+
305
+ /**
306
+ * @private
307
+ *
308
+ * Given a URI in string format, parse that sucker into its basic
309
+ * components and assign them to this object. A URI is of the form:
310
+ * <scheme>:<authority><path>?<query>#<fragment>
311
+ *
312
+ * For simplicity, we parse the URI in the following order:
313
+ *
314
+ * 1. Fragment (anchors)
315
+ * 2. Query (CGI stuff)
316
+ * 3. Scheme ("http")
317
+ * 4. Authority (host name)
318
+ * 5. Username/Password (if any)
319
+ * 6. Port (server port if any)
320
+ * 7. Path (/homepages/mypage.html)
321
+ *
322
+ * The reason for this order is to minimize any parsing ambiguities.
323
+ * Fragments and queries can contain almost anything (they are parts
324
+ * that can contain custom data with their own syntax). Parsing
325
+ * them out first removes a large chance of parsing errors. This
326
+ * method expects well formed URI's, but performing the parse in
327
+ * this order makes us a little more tolerant of user error.
328
+ *
329
+ * REGEXP
330
+ * Why doesn't this use regular expressions to parse the URI? We
331
+ * have found that in a real world scenario, URI's are not always
332
+ * well formed. Sometimes characters that should have been escaped
333
+ * are not, and those situations would break a regexp pattern. This
334
+ * function attempts to be smart about what it is parsing based on
335
+ * location of characters relative to eachother. This function has
336
+ * been proven through real-world use to parse the vast majority
337
+ * of URI's correctly.
338
+ *
339
+ * NOTE
340
+ * It is assumed that the string in URI form is escaped. This function
341
+ * does not escape anything. If you constructed the URI string by
342
+ * hand, and used this to parse in the URI and still need it escaped,
343
+ * call forceEscape() on your URI object.
344
+ *
345
+ * Parsing Assumptions
346
+ * This routine assumes that the URI being passed is well formed.
347
+ * Passing things like local paths, malformed URI's, and the such
348
+ * will result in parsing errors. This function can handle
349
+ * - absolute hierarchical (e.g. "http://something.com/index.html),
350
+ * - relative hierarchical (e.g. "../images/flower.gif"), or
351
+ * - non-hierarchical URIs (e.g. "mailto:jsmith@fungoo.com").
352
+ *
353
+ * Anything else will probably result in a parsing error, or a bogus
354
+ * URI object.
355
+ *
356
+ * Note that non-hierarchical URIs *MUST* have a scheme, otherwise
357
+ * they will be mistaken for relative URI's.
358
+ *
359
+ * If you are not sure what is being passed to you (like manually
360
+ * entered text from UI), you can construct a blank URI object and
361
+ * call unknownToURI() passing in the unknown string.
362
+ *
363
+ * @return true if successful, false if there was some kind of
364
+ * parsing error
365
+ */
366
+ protected function parseURI(uri:String) : Boolean
367
+ {
368
+ var baseURI:String = uri;
369
+ var index:int, index2:int;
370
+
371
+ // Make sure this object is clean before we start. If it was used
372
+ // before and we are now parsing a new URI, we don't want any stale
373
+ // info lying around.
374
+ initialize();
375
+
376
+ // Remove any fragments (anchors) from the URI
377
+ index = baseURI.indexOf("#");
378
+ if (index != -1)
379
+ {
380
+ // Store the fragment piece if any
381
+ if (baseURI.length > (index + 1)) // +1 is to skip the '#'
382
+ _fragment = baseURI.substr(index + 1, baseURI.length - (index + 1));
383
+
384
+ // Trim off the fragment
385
+ baseURI = baseURI.substr(0, index);
386
+ }
387
+
388
+ // We need to strip off any CGI parameters (eg '?param=bob')
389
+ index = baseURI.indexOf("?");
390
+ if (index != -1)
391
+ {
392
+ if (baseURI.length > (index + 1))
393
+ _query = baseURI.substr(index + 1, baseURI.length - (index + 1)); // +1 is to skip the '?'
394
+
395
+ // Trim off the query
396
+ baseURI = baseURI.substr(0, index);
397
+ }
398
+
399
+ // Now try to find the scheme part
400
+ index = baseURI.search(':');
401
+ index2 = baseURI.search('/');
402
+
403
+ var containsColon:Boolean = (index != -1);
404
+ var containsSlash:Boolean = (index2 != -1);
405
+
406
+ // This value is indeterminate if "containsColon" is false.
407
+ // (if there is no colon, does the slash come before or
408
+ // after said non-existing colon?)
409
+ var colonBeforeSlash:Boolean = (!containsSlash || index < index2);
410
+
411
+ // If it has a colon and it's before the first slash, we will treat
412
+ // it as a scheme. If a slash is before a colon, there must be a
413
+ // stray colon in a path or something. In which case, the colon is
414
+ // not the separator for the scheme. Technically, we could consider
415
+ // this an error, but since this is not an ambiguous state (we know
416
+ // 100% that this has no scheme), we will keep going.
417
+ if (containsColon && colonBeforeSlash)
418
+ {
419
+ // We found a scheme
420
+ _scheme = baseURI.substr(0, index);
421
+
422
+ // Normalize the scheme
423
+ _scheme = _scheme.toLowerCase();
424
+
425
+ baseURI = baseURI.substr(index + 1);
426
+
427
+ if (baseURI.substr(0, 2) == "//")
428
+ {
429
+ // This is a hierarchical URI
430
+ _nonHierarchical = "";
431
+
432
+ // Trim off the "//"
433
+ baseURI = baseURI.substr(2, baseURI.length - 2);
434
+ }
435
+ else
436
+ {
437
+ // This is a non-hierarchical URI like "mailto:bob@mail.com"
438
+ _nonHierarchical = baseURI;
439
+
440
+ if ((_valid = validateURI()) == false)
441
+ initialize(); // Bad URI. Clear it.
442
+
443
+ // No more parsing to do for this case
444
+ return isValid();
445
+ }
446
+ }
447
+ else
448
+ {
449
+ // No scheme. We will consider this a relative URI
450
+ _scheme = "";
451
+ _relative = true;
452
+ _nonHierarchical = "";
453
+ }
454
+
455
+ // Ok, what we have left is everything after the <scheme>://
456
+
457
+ // Now that we have stripped off any query and fragment parts, we
458
+ // need to split the authority from the path
459
+
460
+ if (isRelative())
461
+ {
462
+ // Don't bother looking for the authority. It's a relative URI
463
+ _authority = "";
464
+ _port = "";
465
+ _path = baseURI;
466
+ }
467
+ else
468
+ {
469
+ // Check for malformed UNC style file://///server/type/path/
470
+ // By the time we get here, we have already trimmed the "file://"
471
+ // so baseURI will be ///server/type/path. If baseURI only
472
+ // has one slash, we leave it alone because that is valid (that
473
+ // is the case of "file:///path/to/file.txt" where there is no
474
+ // server - implicit "localhost").
475
+ if (baseURI.substr(0, 2) == "//")
476
+ {
477
+ // Trim all leading slashes
478
+ while(baseURI.charAt(0) == "/")
479
+ baseURI = baseURI.substr(1, baseURI.length - 1);
480
+ }
481
+
482
+ index = baseURI.search('/');
483
+ if (index == -1)
484
+ {
485
+ // No path. We must have passed something like "http://something.com"
486
+ _authority = baseURI;
487
+ _path = "";
488
+ }
489
+ else
490
+ {
491
+ _authority = baseURI.substr(0, index);
492
+ _path = baseURI.substr(index, baseURI.length - index);
493
+ }
494
+
495
+ // Check to see if the URI has any username or password information.
496
+ // For example: ftp://username:password@server.com
497
+ index = _authority.search('@');
498
+ if (index != -1)
499
+ {
500
+ // We have a username and possibly a password
501
+ _username = _authority.substr(0, index);
502
+
503
+ // Remove the username/password from the authority
504
+ _authority = _authority.substr(index + 1); // Skip the '@'
505
+
506
+ // Now check to see if the username also has a password
507
+ index = _username.search(':');
508
+ if (index != -1)
509
+ {
510
+ _password = _username.substring(index + 1, _username.length);
511
+ _username = _username.substr(0, index);
512
+ }
513
+ else
514
+ _password = "";
515
+ }
516
+ else
517
+ {
518
+ _username = "";
519
+ _password = "";
520
+ }
521
+
522
+ // Lastly, check to see if the authorty has a port number.
523
+ // This is parsed after the username/password to avoid conflicting
524
+ // with the ':' in the 'username:password' if one exists.
525
+ index = _authority.search(':');
526
+ if (index != -1)
527
+ {
528
+ _port = _authority.substring(index + 1, _authority.length); // skip the ':'
529
+ _authority = _authority.substr(0, index);
530
+ }
531
+ else
532
+ {
533
+ _port = "";
534
+ }
535
+
536
+ // Lastly, normalize the authority. Domain names
537
+ // are case insensitive.
538
+ _authority = _authority.toLowerCase();
539
+ }
540
+
541
+ if ((_valid = validateURI()) == false)
542
+ initialize(); // Bad URI. Clear it
543
+
544
+ return isValid();
545
+ }
546
+
547
+
548
+ /********************************************************************
549
+ * Copy function.
550
+ */
551
+ public function copyURI(uri:URI) : void
552
+ {
553
+ this._scheme = uri._scheme;
554
+ this._authority = uri._authority;
555
+ this._username = uri._username;
556
+ this._password = uri._password;
557
+ this._port = uri._port;
558
+ this._path = uri._path;
559
+ this._query = uri._query;
560
+ this._fragment = uri._fragment;
561
+ this._nonHierarchical = uri._nonHierarchical;
562
+
563
+ this._valid = uri._valid;
564
+ this._relative = uri._relative;
565
+ }
566
+
567
+
568
+ /**
569
+ * @private
570
+ * Checks if the given string only contains a-z or A-Z.
571
+ */
572
+ protected function verifyAlpha(str:String) : Boolean
573
+ {
574
+ var pattern:RegExp = /[^a-z]/;
575
+ var index:int;
576
+
577
+ str = str.toLowerCase();
578
+ index = str.search(pattern);
579
+
580
+ if (index == -1)
581
+ return true;
582
+ else
583
+ return false;
584
+ }
585
+
586
+ /**
587
+ * Is this a valid URI?
588
+ *
589
+ * @return true if this object represents a valid URI, false
590
+ * otherwise.
591
+ */
592
+ public function isValid() : Boolean
593
+ {
594
+ return this._valid;
595
+ }
596
+
597
+
598
+ /**
599
+ * Is this URI an absolute URI? An absolute URI is a complete, fully
600
+ * qualified reference to a resource. e.g. http://site.com/index.htm
601
+ * Non-hierarchical URI's are always absolute.
602
+ */
603
+ public function isAbsolute() : Boolean
604
+ {
605
+ return !this._relative;
606
+ }
607
+
608
+
609
+ /**
610
+ * Is this URI a relative URI? Relative URI's do not have a scheme
611
+ * and only contain a relative path with optional anchor and query
612
+ * parts. e.g. "../reports/index.htm". Non-hierarchical URI's
613
+ * will never be relative.
614
+ */
615
+ public function isRelative() : Boolean
616
+ {
617
+ return this._relative;
618
+ }
619
+
620
+
621
+ /**
622
+ * Does this URI point to a resource that is a directory/folder?
623
+ * The URI specification dictates that any path that ends in a slash
624
+ * is a directory. This is needed to be able to perform correct path
625
+ * logic when combining relative URI's with absolute URI's to
626
+ * obtain the correct absolute URI to a resource.
627
+ *
628
+ * @see URI.chdir
629
+ *
630
+ * @return true if this URI represents a directory resource, false
631
+ * if this URI represents a file resource.
632
+ */
633
+ public function isDirectory() : Boolean
634
+ {
635
+ if (_path.length == 0)
636
+ return false;
637
+
638
+ return (_path.charAt(path.length - 1) == '/');
639
+ }
640
+
641
+
642
+ /**
643
+ * Is this URI a hierarchical URI? URI's can be
644
+ */
645
+ public function isHierarchical() : Boolean
646
+ {
647
+ return hierState;
648
+ }
649
+
650
+
651
+ /**
652
+ * The scheme of the URI.
653
+ */
654
+ public function get scheme() : String
655
+ {
656
+ return URI.unescapeChars(_scheme);
657
+ }
658
+ public function set scheme(schemeStr:String) : void
659
+ {
660
+ // Normalize the scheme
661
+ var normalized:String = schemeStr.toLowerCase();
662
+ _scheme = URI.fastEscapeChars(normalized, URI.URIschemeExcludedBitmap);
663
+ }
664
+
665
+
666
+ /**
667
+ * The authority (host) of the URI. Only valid for
668
+ * hierarchical URI's. If the URI is relative, this will
669
+ * be an empty string. When setting this value, the string
670
+ * given is assumed to be unescaped. When retrieving this
671
+ * value, the resulting string is unescaped.
672
+ */
673
+ public function get authority() : String
674
+ {
675
+ return URI.unescapeChars(_authority);
676
+ }
677
+ public function set authority(authorityStr:String) : void
678
+ {
679
+ // Normalize the authority
680
+ authorityStr = authorityStr.toLowerCase();
681
+
682
+ _authority = URI.fastEscapeChars(authorityStr,
683
+ URI.URIauthorityExcludedBitmap);
684
+
685
+ // Only hierarchical URI's can have an authority, make
686
+ // sure this URI is of the proper format.
687
+ this.hierState = true;
688
+ }
689
+
690
+
691
+ /**
692
+ * The username of the URI. Only valid for hierarchical
693
+ * URI's. If the URI is relative, this will be an empty
694
+ * string.
695
+ *
696
+ * <p>The URI specification allows for authentication
697
+ * credentials to be embedded in the URI as such:</p>
698
+ *
699
+ * <p>http://user:passwd&#64;host/path/to/file.htm</p>
700
+ *
701
+ * <p>When setting this value, the string
702
+ * given is assumed to be unescaped. When retrieving this
703
+ * value, the resulting string is unescaped.</p>
704
+ */
705
+ public function get username() : String
706
+ {
707
+ return URI.unescapeChars(_username);
708
+ }
709
+ public function set username(usernameStr:String) : void
710
+ {
711
+ _username = URI.fastEscapeChars(usernameStr, URI.URIuserpassExcludedBitmap);
712
+
713
+ // Only hierarchical URI's can have a username.
714
+ this.hierState = true;
715
+ }
716
+
717
+
718
+ /**
719
+ * The password of the URI. Similar to username.
720
+ * @see URI.username
721
+ */
722
+ public function get password() : String
723
+ {
724
+ return URI.unescapeChars(_password);
725
+ }
726
+ public function set password(passwordStr:String) : void
727
+ {
728
+ _password = URI.fastEscapeChars(passwordStr,
729
+ URI.URIuserpassExcludedBitmap);
730
+
731
+ // Only hierarchical URI's can have a password.
732
+ this.hierState = true;
733
+ }
734
+
735
+
736
+ /**
737
+ * The host port number. Only valid for hierarchical URI's. If
738
+ * the URI is relative, this will be an empty string. URI's can
739
+ * contain the port number of the remote host:
740
+ *
741
+ * <p>http://site.com:8080/index.htm</p>
742
+ */
743
+ public function get port() : String
744
+ {
745
+ return URI.unescapeChars(_port);
746
+ }
747
+ public function set port(portStr:String) : void
748
+ {
749
+ _port = URI.escapeChars(portStr);
750
+
751
+ // Only hierarchical URI's can have a port.
752
+ this.hierState = true;
753
+ }
754
+
755
+
756
+ /**
757
+ * The path portion of the URI. Only valid for hierarchical
758
+ * URI's. When setting this value, the string
759
+ * given is assumed to be unescaped. When retrieving this
760
+ * value, the resulting string is unescaped.
761
+ *
762
+ * <p>The path portion can be in one of two formats. 1) an absolute
763
+ * path, or 2) a relative path. An absolute path starts with a
764
+ * slash ('/'), a relative path does not.</p>
765
+ *
766
+ * <p>An absolute path may look like:</p>
767
+ * <listing>/full/path/to/my/file.htm</listing>
768
+ *
769
+ * <p>A relative path may look like:</p>
770
+ * <listing>
771
+ * path/to/my/file.htm
772
+ * ../images/logo.gif
773
+ * ../../reports/index.htm
774
+ * </listing>
775
+ *
776
+ * <p>Paths can be absolute or relative. Note that this not the same as
777
+ * an absolute or relative URI. An absolute URI can only have absolute
778
+ * paths. For example:</p>
779
+ *
780
+ * <listing>http:/site.com/path/to/file.htm</listing>
781
+ *
782
+ * <p>This absolute URI has an absolute path of "/path/to/file.htm".</p>
783
+ *
784
+ * <p>Relative URI's can have either absolute paths or relative paths.
785
+ * All of the following relative URI's are valid:</p>
786
+ *
787
+ * <listing>
788
+ * /absolute/path/to/file.htm
789
+ * path/to/file.htm
790
+ * ../path/to/file.htm
791
+ * </listing>
792
+ */
793
+ public function get path() : String
794
+ {
795
+ return URI.unescapeChars(_path);
796
+ }
797
+ public function set path(pathStr:String) : void
798
+ {
799
+ this._path = URI.fastEscapeChars(pathStr, URI.URIpathExcludedBitmap);
800
+
801
+ if (this._scheme == UNKNOWN_SCHEME)
802
+ {
803
+ // We set the path. This is a valid URI now.
804
+ this._scheme = "";
805
+ }
806
+
807
+ // Only hierarchical URI's can have a path.
808
+ hierState = true;
809
+ }
810
+
811
+
812
+ /**
813
+ * The query (CGI) portion of the URI. This part is valid for
814
+ * both hierarchical and non-hierarchical URI's.
815
+ *
816
+ * <p>This accessor should only be used if a custom query syntax
817
+ * is used. This URI class supports the common "param=value"
818
+ * style query syntax via the get/setQueryValue() and
819
+ * get/setQueryByMap() functions. Those functions should be used
820
+ * instead if the common syntax is being used.
821
+ *
822
+ * <p>The URI RFC does not specify any particular
823
+ * syntax for the query part of a URI. It is intended to allow
824
+ * any format that can be agreed upon by the two communicating hosts.
825
+ * However, most systems have standardized on the typical CGI
826
+ * format:</p>
827
+ *
828
+ * <listing>http://site.com/script.php?param1=value1&param2=value2</listing>
829
+ *
830
+ * <p>This class has specific support for this query syntax</p>
831
+ *
832
+ * <p>This common query format is an array of name/value
833
+ * pairs with its own syntax that is different from the overall URI
834
+ * syntax. The query has its own escaping logic. For a query part
835
+ * to be properly escaped and unescaped, it must be split into its
836
+ * component parts. This accessor escapes/unescapes the entire query
837
+ * part without regard for it's component parts. This has the
838
+ * possibliity of leaving the query string in an ambiguious state in
839
+ * regards to its syntax. If the contents of the query part are
840
+ * important, it is recommended that get/setQueryValue() or
841
+ * get/setQueryByMap() are used instead.</p>
842
+ *
843
+ * If a different query syntax is being used, a subclass of URI
844
+ * can be created to handle that specific syntax.
845
+ *
846
+ * @see URI.getQueryValue, URI.getQueryByMap
847
+ */
848
+ public function get query() : String
849
+ {
850
+ return URI.unescapeChars(_query);
851
+ }
852
+ public function set query(queryStr:String) : void
853
+ {
854
+ _query = URI.fastEscapeChars(queryStr, URI.URIqueryExcludedBitmap);
855
+
856
+ // both hierarchical and non-hierarchical URI's can
857
+ // have a query. Do not set the hierState.
858
+ }
859
+
860
+ /**
861
+ * Accessor to the raw query data. If you are using a custom query
862
+ * syntax, this accessor can be used to get and set the query part
863
+ * directly with no escaping/unescaping. This should ONLY be used
864
+ * if your application logic is handling custom query logic and
865
+ * handling the proper escaping of the query part.
866
+ */
867
+ public function get queryRaw() : String
868
+ {
869
+ return _query;
870
+ }
871
+ public function set queryRaw(queryStr:String) : void
872
+ {
873
+ _query = queryStr;
874
+ }
875
+
876
+
877
+ /**
878
+ * The fragment (anchor) portion of the URI. This is valid for
879
+ * both hierarchical and non-hierarchical URI's.
880
+ */
881
+ public function get fragment() : String
882
+ {
883
+ return URI.unescapeChars(_fragment);
884
+ }
885
+ public function set fragment(fragmentStr:String) : void
886
+ {
887
+ _fragment = URI.fastEscapeChars(fragmentStr, URIfragmentExcludedBitmap);
888
+
889
+ // both hierarchical and non-hierarchical URI's can
890
+ // have a fragment. Do not set the hierState.
891
+ }
892
+
893
+
894
+ /**
895
+ * The non-hierarchical part of the URI. For example, if
896
+ * this URI object represents "mailto:somebody@company.com",
897
+ * this will contain "somebody@company.com". This is valid only
898
+ * for non-hierarchical URI's.
899
+ */
900
+ public function get nonHierarchical() : String
901
+ {
902
+ return URI.unescapeChars(_nonHierarchical);
903
+ }
904
+ public function set nonHierarchical(nonHier:String) : void
905
+ {
906
+ _nonHierarchical = URI.fastEscapeChars(nonHier, URInonHierexcludedBitmap);
907
+
908
+ // This is a non-hierarchical URI.
909
+ this.hierState = false;
910
+ }
911
+
912
+
913
+ /**
914
+ * Quick shorthand accessor to set the parts of this URI.
915
+ * The given parts are assumed to be in unescaped form. If
916
+ * the URI is non-hierarchical (e.g. mailto:) you will need
917
+ * to call SetScheme() and SetNonHierarchical().
918
+ */
919
+ public function setParts(schemeStr:String, authorityStr:String,
920
+ portStr:String, pathStr:String, queryStr:String,
921
+ fragmentStr:String) : void
922
+ {
923
+ this.scheme = schemeStr;
924
+ this.authority = authorityStr;
925
+ this.port = portStr;
926
+ this.path = pathStr;
927
+ this.query = queryStr;
928
+ this.fragment = fragmentStr;
929
+
930
+ hierState = true;
931
+ }
932
+
933
+
934
+ /**
935
+ * URI escapes the given character string. This is similar in function
936
+ * to the global encodeURIComponent() function in ActionScript, but is
937
+ * slightly different in regards to which characters get escaped. This
938
+ * escapes the characters specified in the URIbaselineExluded set (see class
939
+ * static members). This is needed for this class to work properly.
940
+ *
941
+ * <p>If a different set of characters need to be used for the escaping,
942
+ * you may use fastEscapeChars() and specify a custom URIEncodingBitmap
943
+ * that contains the characters your application needs escaped.</p>
944
+ *
945
+ * <p>Never pass a full URI to this function. A URI can only be properly
946
+ * escaped/unescaped when split into its component parts (see RFC 3986
947
+ * section 2.4). This is due to the fact that the URI component separators
948
+ * could be characters that would normally need to be escaped.</p>
949
+ *
950
+ * @param unescaped character string to be escaped.
951
+ *
952
+ * @return escaped character string
953
+ *
954
+ * @see encodeURIComponent
955
+ * @see fastEscapeChars
956
+ */
957
+ static public function escapeChars(unescaped:String) : String
958
+ {
959
+ // This uses the excluded set by default.
960
+ return fastEscapeChars(unescaped, URI.URIbaselineExcludedBitmap);
961
+ }
962
+
963
+
964
+ /**
965
+ * Unescape any URI escaped characters in the given character
966
+ * string.
967
+ *
968
+ * <p>Never pass a full URI to this function. A URI can only be properly
969
+ * escaped/unescaped when split into its component parts (see RFC 3986
970
+ * section 2.4). This is due to the fact that the URI component separators
971
+ * could be characters that would normally need to be escaped.</p>
972
+ *
973
+ * @param escaped the escaped string to be unescaped.
974
+ *
975
+ * @return unescaped string.
976
+ */
977
+ static public function unescapeChars(escaped:String /*, onlyHighASCII:Boolean = false*/) : String
978
+ {
979
+ // We can just use the default AS function. It seems to
980
+ // decode everything correctly
981
+ var unescaped:String;
982
+ unescaped = decodeURIComponent(escaped);
983
+ return unescaped;
984
+ }
985
+
986
+ /**
987
+ * Performance focused function that escapes the given character
988
+ * string using the given URIEncodingBitmap as the rule for what
989
+ * characters need to be escaped. This function is used by this
990
+ * class and can be used externally to this class to perform
991
+ * escaping on custom character sets.
992
+ *
993
+ * <p>Never pass a full URI to this function. A URI can only be properly
994
+ * escaped/unescaped when split into its component parts (see RFC 3986
995
+ * section 2.4). This is due to the fact that the URI component separators
996
+ * could be characters that would normally need to be escaped.</p>
997
+ *
998
+ * @param unescaped the unescaped string to be escaped
999
+ * @param bitmap the set of characters that need to be escaped
1000
+ *
1001
+ * @return the escaped string.
1002
+ */
1003
+ static public function fastEscapeChars(unescaped:String, bitmap:URIEncodingBitmap) : String
1004
+ {
1005
+ var escaped:String = "";
1006
+ var c:String;
1007
+ var x:int, i:int;
1008
+
1009
+ for (i = 0; i < unescaped.length; i++)
1010
+ {
1011
+ c = unescaped.charAt(i);
1012
+
1013
+ x = bitmap.ShouldEscape(c);
1014
+ if (x)
1015
+ {
1016
+ c = x.toString(16);
1017
+ if (c.length == 1)
1018
+ c = "0" + c;
1019
+
1020
+ c = "%" + c;
1021
+ c = c.toUpperCase();
1022
+ }
1023
+
1024
+ escaped += c;
1025
+ }
1026
+
1027
+ return escaped;
1028
+ }
1029
+
1030
+
1031
+ /**
1032
+ * Is this URI of a particular scheme type? For example,
1033
+ * passing "http" to a URI object that represents the URI
1034
+ * "http://site.com/" would return true.
1035
+ *
1036
+ * @param scheme scheme to check for
1037
+ *
1038
+ * @return true if this URI object is of the given type, false
1039
+ * otherwise.
1040
+ */
1041
+ public function isOfType(scheme:String) : Boolean
1042
+ {
1043
+ // Schemes are never case sensitive. Ignore case.
1044
+ scheme = scheme.toLowerCase();
1045
+ return (this._scheme == scheme);
1046
+ }
1047
+
1048
+
1049
+ /**
1050
+ * Get the value for the specified named in the query part. This
1051
+ * assumes the query part of the URI is in the common
1052
+ * "name1=value1&name2=value2" syntax. Do not call this function
1053
+ * if you are using a custom query syntax.
1054
+ *
1055
+ * @param name name of the query value to get.
1056
+ *
1057
+ * @return the value of the query name, empty string if the
1058
+ * query name does not exist.
1059
+ */
1060
+ public function getQueryValue(name:String) : String
1061
+ {
1062
+ var map:Object;
1063
+ var item:String;
1064
+ var value:String;
1065
+
1066
+ map = getQueryByMap();
1067
+
1068
+ for (item in map)
1069
+ {
1070
+ if (item == name)
1071
+ {
1072
+ value = map[item];
1073
+ return value;
1074
+ }
1075
+ }
1076
+
1077
+ // Didn't find the specified key
1078
+ return new String("");
1079
+ }
1080
+
1081
+
1082
+ /**
1083
+ * Set the given value on the given query name. If the given name
1084
+ * does not exist, it will automatically add this name/value pair
1085
+ * to the query. If null is passed as the value, it will remove
1086
+ * the given item from the query.
1087
+ *
1088
+ * <p>This automatically escapes any characters that may conflict with
1089
+ * the query syntax so that they are "safe" within the query. The
1090
+ * strings passed are assumed to be literal unescaped name and value.</p>
1091
+ *
1092
+ * @param name name of the query value to set
1093
+ * @param value value of the query item to set. If null, this will
1094
+ * force the removal of this item from the query.
1095
+ */
1096
+ public function setQueryValue(name:String, value:String) : void
1097
+ {
1098
+ var map:Object;
1099
+
1100
+ map = getQueryByMap();
1101
+
1102
+ // If the key doesn't exist yet, this will create a new pair in
1103
+ // the map. If it does exist, this will overwrite the previous
1104
+ // value, which is what we want.
1105
+ map[name] = value;
1106
+
1107
+ setQueryByMap(map);
1108
+ }
1109
+
1110
+
1111
+ /**
1112
+ * Get the query of the URI in an Object class that allows for easy
1113
+ * access to the query data via Object accessors. For example:
1114
+ *
1115
+ * <listing>
1116
+ * var query:Object = uri.getQueryByMap();
1117
+ * var value:String = query["param"]; // get a value
1118
+ * query["param2"] = "foo"; // set a new value
1119
+ * </listing>
1120
+ *
1121
+ * @return Object that contains the name/value pairs of the query.
1122
+ *
1123
+ * @see #setQueryByMap
1124
+ * @see #getQueryValue
1125
+ * @see #setQueryValue
1126
+ */
1127
+ public function getQueryByMap() : Object
1128
+ {
1129
+ var queryStr:String;
1130
+ var pair:String;
1131
+ var pairs:Array;
1132
+ var item:Array;
1133
+ var name:String, value:String;
1134
+ var index:int;
1135
+ var map:Object = new Object();
1136
+
1137
+
1138
+ // We need the raw query string, no unescaping.
1139
+ queryStr = this._query;
1140
+
1141
+ pairs = queryStr.split('&');
1142
+ for each (pair in pairs)
1143
+ {
1144
+ if (pair.length == 0)
1145
+ continue;
1146
+
1147
+ item = pair.split('=');
1148
+
1149
+ if (item.length > 0)
1150
+ name = item[0];
1151
+ else
1152
+ continue; // empty array
1153
+
1154
+ if (item.length > 1)
1155
+ value = item[1];
1156
+ else
1157
+ value = "";
1158
+
1159
+ name = queryPartUnescape(name);
1160
+ value = queryPartUnescape(value);
1161
+
1162
+ map[name] = value;
1163
+ }
1164
+
1165
+ return map;
1166
+ }
1167
+
1168
+
1169
+ /**
1170
+ * Set the query part of this URI using the given object as the
1171
+ * content source. Any member of the object that has a value of
1172
+ * null will not be in the resulting query.
1173
+ *
1174
+ * @param map object that contains the name/value pairs as
1175
+ * members of that object.
1176
+ *
1177
+ * @see #getQueryByMap
1178
+ * @see #getQueryValue
1179
+ * @see #setQueryValue
1180
+ */
1181
+ public function setQueryByMap(map:Object) : void
1182
+ {
1183
+ var item:String;
1184
+ var name:String, value:String;
1185
+ var queryStr:String = "";
1186
+ var tmpPair:String;
1187
+ var foo:String;
1188
+
1189
+ for (item in map)
1190
+ {
1191
+ name = item;
1192
+ value = map[item];
1193
+
1194
+ if (value == null)
1195
+ value = "";
1196
+
1197
+ // Need to escape the name/value pair so that they
1198
+ // don't conflict with the query syntax (specifically
1199
+ // '=', '&', and <whitespace>).
1200
+ name = queryPartEscape(name);
1201
+ value = queryPartEscape(value);
1202
+
1203
+ tmpPair = name;
1204
+
1205
+ if (value.length > 0)
1206
+ {
1207
+ tmpPair += "=";
1208
+ tmpPair += value;
1209
+ }
1210
+
1211
+ if (queryStr.length != 0)
1212
+ queryStr += '&'; // Add the separator
1213
+
1214
+ queryStr += tmpPair;
1215
+ }
1216
+
1217
+ // We don't want to escape. We already escaped the
1218
+ // individual name/value pairs. If we escaped the
1219
+ // query string again by assigning it to "query",
1220
+ // we would have double escaping.
1221
+ _query = queryStr;
1222
+ }
1223
+
1224
+
1225
+ /**
1226
+ * Similar to Escape(), except this also escapes characters that
1227
+ * would conflict with the name/value pair query syntax. This is
1228
+ * intended to be called on each individual "name" and "value"
1229
+ * in the query making sure that nothing in the name or value
1230
+ * strings contain characters that would conflict with the query
1231
+ * syntax (e.g. '=' and '&').
1232
+ *
1233
+ * @param unescaped unescaped string that is to be escaped.
1234
+ *
1235
+ * @return escaped string.
1236
+ *
1237
+ * @see #queryUnescape
1238
+ */
1239
+ static public function queryPartEscape(unescaped:String) : String
1240
+ {
1241
+ var escaped:String = unescaped;
1242
+ escaped = URI.fastEscapeChars(unescaped, URI.URIqueryPartExcludedBitmap);
1243
+ return escaped;
1244
+ }
1245
+
1246
+
1247
+ /**
1248
+ * Unescape the individual name/value string pairs.
1249
+ *
1250
+ * @param escaped escaped string to be unescaped
1251
+ *
1252
+ * @return unescaped string
1253
+ *
1254
+ * @see #queryEscape
1255
+ */
1256
+ static public function queryPartUnescape(escaped:String) : String
1257
+ {
1258
+ var unescaped:String = escaped;
1259
+ unescaped = unescapeChars(unescaped);
1260
+ return unescaped;
1261
+ }
1262
+
1263
+ /**
1264
+ * Output this URI as a string. The resulting string is properly
1265
+ * escaped and well formed for machine processing.
1266
+ */
1267
+ public function toString() : String
1268
+ {
1269
+ if (this == null)
1270
+ return "";
1271
+ else
1272
+ return toStringInternal(false);
1273
+ }
1274
+
1275
+ /**
1276
+ * Output the URI as a string that is easily readable by a human.
1277
+ * This outputs the URI with all escape sequences unescaped to
1278
+ * their character representation. This makes the URI easier for
1279
+ * a human to read, but the URI could be completely invalid
1280
+ * because some unescaped characters may now cause ambiguous parsing.
1281
+ * This function should only be used if you want to display a URI to
1282
+ * a user. This function should never be used outside that specific
1283
+ * case.
1284
+ *
1285
+ * @return the URI in string format with all escape sequences
1286
+ * unescaped.
1287
+ *
1288
+ * @see #toString
1289
+ */
1290
+ public function toDisplayString() : String
1291
+ {
1292
+ return toStringInternal(true);
1293
+ }
1294
+
1295
+
1296
+ /**
1297
+ * @private
1298
+ *
1299
+ * The guts of toString()
1300
+ */
1301
+ protected function toStringInternal(forDisplay:Boolean) : String
1302
+ {
1303
+ var uri:String = "";
1304
+ var part:String = "";
1305
+
1306
+ if (isHierarchical() == false)
1307
+ {
1308
+ // non-hierarchical URI
1309
+
1310
+ uri += (forDisplay ? this.scheme : _scheme);
1311
+ uri += ":";
1312
+ uri += (forDisplay ? this.nonHierarchical : _nonHierarchical);
1313
+ }
1314
+ else
1315
+ {
1316
+ // Hierarchical URI
1317
+
1318
+ if (isRelative() == false)
1319
+ {
1320
+ // If it is not a relative URI, then we want the scheme and
1321
+ // authority parts in the string. If it is relative, we
1322
+ // do NOT want this stuff.
1323
+
1324
+ if (_scheme.length != 0)
1325
+ {
1326
+ part = (forDisplay ? this.scheme : _scheme);
1327
+ uri += part + ":";
1328
+ }
1329
+
1330
+ if (_authority.length != 0 || isOfType("file"))
1331
+ {
1332
+ uri += "//";
1333
+
1334
+ // Add on any username/password associated with this
1335
+ // authority
1336
+ if (_username.length != 0)
1337
+ {
1338
+ part = (forDisplay ? this.username : _username);
1339
+ uri += part;
1340
+
1341
+ if (_password.length != 0)
1342
+ {
1343
+ part = (forDisplay ? this.password : _password);
1344
+ uri += ":" + part;
1345
+ }
1346
+
1347
+ uri += "@";
1348
+ }
1349
+
1350
+ // add the authority
1351
+ part = (forDisplay ? this.authority : _authority);
1352
+ uri += part;
1353
+
1354
+ // Tack on the port number, if any
1355
+ if (port.length != 0)
1356
+ uri += ":" + port;
1357
+ }
1358
+ }
1359
+
1360
+ // Tack on the path
1361
+ part = (forDisplay ? this.path : _path);
1362
+ uri += part;
1363
+
1364
+ } // end hierarchical part
1365
+
1366
+ // Both non-hier and hierarchical have query and fragment parts
1367
+
1368
+ // Add on the query and fragment parts
1369
+ if (_query.length != 0)
1370
+ {
1371
+ part = (forDisplay ? this.query : _query);
1372
+ uri += "?" + part;
1373
+ }
1374
+
1375
+ if (fragment.length != 0)
1376
+ {
1377
+ part = (forDisplay ? this.fragment : _fragment);
1378
+ uri += "#" + part;
1379
+ }
1380
+
1381
+ return uri;
1382
+ }
1383
+
1384
+ /**
1385
+ * Forcefully ensure that this URI is properly escaped.
1386
+ *
1387
+ * <p>Sometimes URI's are constructed by hand using strings outside
1388
+ * this class. In those cases, it is unlikely the URI has been
1389
+ * properly escaped. This function forcefully escapes this URI
1390
+ * by unescaping each part and then re-escaping it. If the URI
1391
+ * did not have any escaping, the first unescape will do nothing
1392
+ * and then the re-escape will properly escape everything. If
1393
+ * the URI was already escaped, the unescape and re-escape will
1394
+ * essentally be a no-op. This provides a safe way to make sure
1395
+ * a URI is in the proper escaped form.</p>
1396
+ */
1397
+ public function forceEscape() : void
1398
+ {
1399
+ // The accessors for each of the members will unescape
1400
+ // and then re-escape as we get and assign them.
1401
+
1402
+ // Handle the parts that are common for both hierarchical
1403
+ // and non-hierarchical URI's
1404
+ this.scheme = this.scheme;
1405
+ this.setQueryByMap(this.getQueryByMap());
1406
+ this.fragment = this.fragment;
1407
+
1408
+ if (isHierarchical())
1409
+ {
1410
+ this.authority = this.authority;
1411
+ this.path = this.path;
1412
+ this.port = this.port;
1413
+ this.username = this.username;
1414
+ this.password = this.password;
1415
+ }
1416
+ else
1417
+ {
1418
+ this.nonHierarchical = this.nonHierarchical;
1419
+ }
1420
+ }
1421
+
1422
+
1423
+ /**
1424
+ * Does this URI point to a resource of the given file type?
1425
+ * Given a file extension (or just a file name, this will strip the
1426
+ * extension), check to see if this URI points to a file of that
1427
+ * type.
1428
+ *
1429
+ * @param extension string that contains a file extension with or
1430
+ * without a dot ("html" and ".html" are both valid), or a file
1431
+ * name with an extension (e.g. "index.html").
1432
+ *
1433
+ * @return true if this URI points to a resource with the same file
1434
+ * file extension as the extension provided, false otherwise.
1435
+ */
1436
+ public function isOfFileType(extension:String) : Boolean
1437
+ {
1438
+ var thisExtension:String;
1439
+ var index:int;
1440
+
1441
+ index = extension.lastIndexOf(".");
1442
+ if (index != -1)
1443
+ {
1444
+ // Strip the extension
1445
+ extension = extension.substr(index + 1);
1446
+ }
1447
+ else
1448
+ {
1449
+ // The caller passed something without a dot in it. We
1450
+ // will assume that it is just a plain extension (e.g. "html").
1451
+ // What they passed is exactly what we want
1452
+ }
1453
+
1454
+ thisExtension = getExtension(true);
1455
+
1456
+ if (thisExtension == "")
1457
+ return false;
1458
+
1459
+ // Compare the extensions ignoring case
1460
+ if (compareStr(thisExtension, extension, false) == 0)
1461
+ return true;
1462
+ else
1463
+ return false;
1464
+ }
1465
+
1466
+
1467
+ /**
1468
+ * Get the ".xyz" file extension from the filename in the URI.
1469
+ * For example, if we have the following URI:
1470
+ *
1471
+ * <listing>http://something.com/path/to/my/page.html?form=yes&name=bob#anchor</listing>
1472
+ *
1473
+ * <p>This will return ".html".</p>
1474
+ *
1475
+ * @param minusDot If true, this will strip the dot from the extension.
1476
+ * If true, the above example would have returned "html".
1477
+ *
1478
+ * @return the file extension
1479
+ */
1480
+ public function getExtension(minusDot:Boolean = false) : String
1481
+ {
1482
+ var filename:String = getFilename();
1483
+ var extension:String;
1484
+ var index:int;
1485
+
1486
+ if (filename == "")
1487
+ return String("");
1488
+
1489
+ index = filename.lastIndexOf(".");
1490
+
1491
+ // If it doesn't have an extension, or if it is a "hidden" file,
1492
+ // it doesn't have an extension. Hidden files on unix start with
1493
+ // a dot (e.g. ".login").
1494
+ if (index == -1 || index == 0)
1495
+ return String("");
1496
+
1497
+ extension = filename.substr(index);
1498
+
1499
+ // If the caller does not want the dot, remove it.
1500
+ if (minusDot && extension.charAt(0) == ".")
1501
+ extension = extension.substr(1);
1502
+
1503
+ return extension;
1504
+ }
1505
+
1506
+ /**
1507
+ * Quick function to retrieve the file name off the end of a URI.
1508
+ *
1509
+ * <p>For example, if the URI is:</p>
1510
+ * <listing>http://something.com/some/path/to/my/file.html</listing>
1511
+ * <p>this function will return "file.html".</p>
1512
+ *
1513
+ * @param minusExtension true if the file extension should be stripped
1514
+ *
1515
+ * @return the file name. If this URI is a directory, the return
1516
+ * value will be empty string.
1517
+ */
1518
+ public function getFilename(minusExtension:Boolean = false) : String
1519
+ {
1520
+ if (isDirectory())
1521
+ return String("");
1522
+
1523
+ var pathStr:String = this.path;
1524
+ var filename:String;
1525
+ var index:int;
1526
+
1527
+ // Find the last path separator.
1528
+ index = pathStr.lastIndexOf("/");
1529
+
1530
+ if (index != -1)
1531
+ filename = pathStr.substr(index + 1);
1532
+ else
1533
+ filename = pathStr;
1534
+
1535
+ if (minusExtension)
1536
+ {
1537
+ // The caller has requested that the extension be removed
1538
+ index = filename.lastIndexOf(".");
1539
+
1540
+ if (index != -1)
1541
+ filename = filename.substr(0, index);
1542
+ }
1543
+
1544
+ return filename;
1545
+ }
1546
+
1547
+
1548
+ /**
1549
+ * @private
1550
+ * Helper function to compare strings.
1551
+ *
1552
+ * @return true if the two strings are identical, false otherwise.
1553
+ */
1554
+ static protected function compareStr(str1:String, str2:String,
1555
+ sensitive:Boolean = true) : Boolean
1556
+ {
1557
+ if (sensitive == false)
1558
+ {
1559
+ str1 = str1.toLowerCase();
1560
+ str2 = str2.toLowerCase();
1561
+ }
1562
+
1563
+ return (str1 == str2)
1564
+ }
1565
+
1566
+ /**
1567
+ * Based on the type of this URI (http, ftp, etc.) get
1568
+ * the default port used for that protocol. This is
1569
+ * just intended to be a helper function for the most
1570
+ * common cases.
1571
+ */
1572
+ public function getDefaultPort() : String
1573
+ {
1574
+ if (_scheme == "http")
1575
+ return String("80");
1576
+ else if (_scheme == "ftp")
1577
+ return String("21");
1578
+ else if (_scheme == "file")
1579
+ return String("");
1580
+ else if (_scheme == "sftp")
1581
+ return String("22"); // ssh standard port
1582
+ else
1583
+ {
1584
+ // Don't know the port for this URI type
1585
+ return String("");
1586
+ }
1587
+ }
1588
+
1589
+ /**
1590
+ * @private
1591
+ *
1592
+ * This resolves the given URI if the application has a
1593
+ * resolver interface defined. This function does not
1594
+ * modify the passed in URI and returns a new URI.
1595
+ */
1596
+ static protected function resolve(uri:URI) : URI
1597
+ {
1598
+ var copy:URI = new URI();
1599
+ copy.copyURI(uri);
1600
+
1601
+ if (_resolver != null)
1602
+ {
1603
+ // A resolver class has been registered. Call it.
1604
+ return _resolver.resolve(copy);
1605
+ }
1606
+ else
1607
+ {
1608
+ // No resolver. Nothing to do, but we don't
1609
+ // want to reuse the one passed in.
1610
+ return copy;
1611
+ }
1612
+ }
1613
+
1614
+ /**
1615
+ * Accessor to set and get the resolver object used by all URI
1616
+ * objects to dynamically resolve URI's before comparison.
1617
+ */
1618
+ static public function set resolver(resolver:IURIResolver) : void
1619
+ {
1620
+ _resolver = resolver;
1621
+ }
1622
+ static public function get resolver() : IURIResolver
1623
+ {
1624
+ return _resolver;
1625
+ }
1626
+
1627
+ /**
1628
+ * Given another URI, return this URI object's relation to the one given.
1629
+ * URI's can have 1 of 4 possible relationships. They can be unrelated,
1630
+ * equal, parent, or a child of the given URI.
1631
+ *
1632
+ * @param uri URI to compare this URI object to.
1633
+ * @param caseSensitive true if the URI comparison should be done
1634
+ * taking case into account, false if the comparison should be
1635
+ * performed case insensitive.
1636
+ *
1637
+ * @return URI.NOT_RELATED, URI.CHILD, URI.PARENT, or URI.EQUAL
1638
+ */
1639
+ public function getRelation(uri:URI, caseSensitive:Boolean = true) : int
1640
+ {
1641
+ // Give the app a chance to resolve these URI's before we compare them.
1642
+ var thisURI:URI = URI.resolve(this);
1643
+ var thatURI:URI = URI.resolve(uri);
1644
+
1645
+ if (thisURI.isRelative() || thatURI.isRelative())
1646
+ {
1647
+ // You cannot compare relative URI's due to their lack of context.
1648
+ // You could have two relative URI's that look like:
1649
+ // ../../images/
1650
+ // ../../images/marketing/logo.gif
1651
+ // These may appear related, but you have no overall context
1652
+ // from which to make the comparison. The first URI could be
1653
+ // from one site and the other URI could be from another site.
1654
+ return URI.NOT_RELATED;
1655
+ }
1656
+ else if (thisURI.isHierarchical() == false || thatURI.isHierarchical() == false)
1657
+ {
1658
+ // One or both of the URI's are non-hierarchical.
1659
+ if (((thisURI.isHierarchical() == false) && (thatURI.isHierarchical() == true)) ||
1660
+ ((thisURI.isHierarchical() == true) && (thatURI.isHierarchical() == false)))
1661
+ {
1662
+ // XOR. One is hierarchical and the other is
1663
+ // non-hierarchical. They cannot be compared.
1664
+ return URI.NOT_RELATED;
1665
+ }
1666
+ else
1667
+ {
1668
+ // They are both non-hierarchical
1669
+ if (thisURI.scheme != thatURI.scheme)
1670
+ return URI.NOT_RELATED;
1671
+
1672
+ if (thisURI.nonHierarchical != thatURI.nonHierarchical)
1673
+ return URI.NOT_RELATED;
1674
+
1675
+ // The two non-hierarcical URI's are equal.
1676
+ return URI.EQUAL;
1677
+ }
1678
+ }
1679
+
1680
+ // Ok, this URI and the one we are being compared to are both
1681
+ // absolute hierarchical URI's.
1682
+
1683
+ if (thisURI.scheme != thatURI.scheme)
1684
+ return URI.NOT_RELATED;
1685
+
1686
+ if (thisURI.authority != thatURI.authority)
1687
+ return URI.NOT_RELATED;
1688
+
1689
+ var thisPort:String = thisURI.port;
1690
+ var thatPort:String = thatURI.port;
1691
+
1692
+ // Different ports are considered completely different servers.
1693
+ if (thisPort == "")
1694
+ thisPort = thisURI.getDefaultPort();
1695
+ if (thatPort == "")
1696
+ thatPort = thatURI.getDefaultPort();
1697
+
1698
+ // Check to see if the port is the default port.
1699
+ if (thisPort != thatPort)
1700
+ return URI.NOT_RELATED;
1701
+
1702
+ if (compareStr(thisURI.path, thatURI.path, caseSensitive))
1703
+ return URI.EQUAL;
1704
+
1705
+ // Special case check. If we are here, the scheme, authority,
1706
+ // and port match, and it is not a relative path, but the
1707
+ // paths did not match. There is a special case where we
1708
+ // could have:
1709
+ // http://something.com/
1710
+ // http://something.com
1711
+ // Technically, these are equal. So lets, check for this case.
1712
+ var thisPath:String = thisURI.path;
1713
+ var thatPath:String = thatURI.path;
1714
+
1715
+ if ( (thisPath == "/" || thatPath == "/") &&
1716
+ (thisPath == "" || thatPath == "") )
1717
+ {
1718
+ // We hit the special case. These two are equal.
1719
+ return URI.EQUAL;
1720
+ }
1721
+
1722
+ // Ok, the paths do not match, but one path may be a parent/child
1723
+ // of the other. For example, we may have:
1724
+ // http://something.com/path/to/homepage/
1725
+ // http://something.com/path/to/homepage/images/logo.gif
1726
+ // In this case, the first is a parent of the second (or the second
1727
+ // is a child of the first, depending on which you compare to the
1728
+ // other). To make this comparison, we must split the path into
1729
+ // its component parts (split the string on the '/' path delimiter).
1730
+ // We then compare the
1731
+ var thisParts:Array, thatParts:Array;
1732
+ var thisPart:String, thatPart:String;
1733
+ var i:int;
1734
+
1735
+ thisParts = thisPath.split("/");
1736
+ thatParts = thatPath.split("/");
1737
+
1738
+ if (thisParts.length > thatParts.length)
1739
+ {
1740
+ thatPart = thatParts[thatParts.length - 1];
1741
+ if (thatPart.length > 0)
1742
+ {
1743
+ // if the last part is not empty, the passed URI is
1744
+ // not a directory. There is no way the passed URI
1745
+ // can be a parent.
1746
+ return URI.NOT_RELATED;
1747
+ }
1748
+ else
1749
+ {
1750
+ // Remove the empty trailing part
1751
+ thatParts.pop();
1752
+ }
1753
+
1754
+ // This may be a child of the one passed in
1755
+ for (i = 0; i < thatParts.length; i++)
1756
+ {
1757
+ thisPart = thisParts[i];
1758
+ thatPart = thatParts[i];
1759
+
1760
+ if (compareStr(thisPart, thatPart, caseSensitive) == false)
1761
+ return URI.NOT_RELATED;
1762
+ }
1763
+
1764
+ return URI.CHILD;
1765
+ }
1766
+ else if (thisParts.length < thatParts.length)
1767
+ {
1768
+ thisPart = thisParts[thisParts.length - 1];
1769
+ if (thisPart.length > 0)
1770
+ {
1771
+ // if the last part is not empty, this URI is not a
1772
+ // directory. There is no way this object can be
1773
+ // a parent.
1774
+ return URI.NOT_RELATED;
1775
+ }
1776
+ else
1777
+ {
1778
+ // Remove the empty trailing part
1779
+ thisParts.pop();
1780
+ }
1781
+
1782
+ // This may be the parent of the one passed in
1783
+ for (i = 0; i < thisParts.length; i++)
1784
+ {
1785
+ thisPart = thisParts[i];
1786
+ thatPart = thatParts[i];
1787
+
1788
+ if (compareStr(thisPart, thatPart, caseSensitive) == false)
1789
+ return URI.NOT_RELATED;
1790
+ }
1791
+
1792
+ return URI.PARENT;
1793
+ }
1794
+ else
1795
+ {
1796
+ // Both URI's have the same number of path components, but
1797
+ // it failed the equivelence check above. This means that
1798
+ // the two URI's are not related.
1799
+ return URI.NOT_RELATED;
1800
+ }
1801
+
1802
+ // If we got here, the scheme and authority are the same,
1803
+ // but the paths pointed to two different locations that
1804
+ // were in different parts of the file system tree
1805
+ return URI.NOT_RELATED;
1806
+ }
1807
+
1808
+ /**
1809
+ * Given another URI, return the common parent between this one
1810
+ * and the provided URI.
1811
+ *
1812
+ * @param uri the other URI from which to find a common parent
1813
+ * @para caseSensitive true if this operation should be done
1814
+ * with case sensitive comparisons.
1815
+ *
1816
+ * @return the parent URI if successful, null otherwise.
1817
+ */
1818
+ public function getCommonParent(uri:URI, caseSensitive:Boolean = true) : URI
1819
+ {
1820
+ var thisURI:URI = URI.resolve(this);
1821
+ var thatURI:URI = URI.resolve(uri);
1822
+
1823
+ if(!thisURI.isAbsolute() || !thatURI.isAbsolute() ||
1824
+ thisURI.isHierarchical() == false ||
1825
+ thatURI.isHierarchical() == false)
1826
+ {
1827
+ // Both URI's must be absolute hierarchical for this to
1828
+ // make sense.
1829
+ return null;
1830
+ }
1831
+
1832
+ var relation:int = thisURI.getRelation(thatURI);
1833
+ if (relation == URI.NOT_RELATED)
1834
+ {
1835
+ // The given URI is not related to this one. No
1836
+ // common parent.
1837
+ return null;
1838
+ }
1839
+
1840
+ thisURI.chdir(".");
1841
+ thatURI.chdir(".");
1842
+
1843
+ var strBefore:String, strAfter:String;
1844
+ do
1845
+ {
1846
+ relation = thisURI.getRelation(thatURI, caseSensitive);
1847
+ if(relation == URI.EQUAL || relation == URI.PARENT)
1848
+ break;
1849
+
1850
+ // If strBefore and strAfter end up being the same,
1851
+ // we know we are at the root of the path because
1852
+ // chdir("..") is doing nothing.
1853
+ strBefore = thisURI.toString();
1854
+ thisURI.chdir("..");
1855
+ strAfter = thisURI.toString();
1856
+ }
1857
+ while(strBefore != strAfter);
1858
+
1859
+ return thisURI;
1860
+ }
1861
+
1862
+
1863
+ /**
1864
+ * This function is used to move around in a URI in a way similar
1865
+ * to the 'cd' or 'chdir' commands on Unix. These operations are
1866
+ * completely string based, using the context of the URI to
1867
+ * determine the position within the path. The heuristics used
1868
+ * to determine the action are based off Appendix C in RFC 2396.
1869
+ *
1870
+ * <p>URI paths that end in '/' are considered paths that point to
1871
+ * directories, while paths that do not end in '/' are files. For
1872
+ * example, if you execute chdir("d") on the following URI's:<br/>
1873
+ * 1. http://something.com/a/b/c/ (directory)<br/>
1874
+ * 2. http://something.com/a/b/c (not directory)<br/>
1875
+ * you will get:<br/>
1876
+ * 1. http://something.com/a/b/c/d<br/>
1877
+ * 2. http://something.com/a/b/d<br/></p>
1878
+ *
1879
+ * <p>See RFC 2396, Appendix C for more info.</p>
1880
+ *
1881
+ * @param reference the URI or path to "cd" to.
1882
+ * @param escape true if the passed reference string should be URI
1883
+ * escaped before using it.
1884
+ *
1885
+ * @return true if the chdir was successful, false otherwise.
1886
+ */
1887
+ public function chdir(reference:String, escape:Boolean = false) : Boolean
1888
+ {
1889
+ var uriReference:URI;
1890
+ var ref:String = reference;
1891
+
1892
+ if (escape)
1893
+ ref = URI.escapeChars(reference);
1894
+
1895
+ if (ref == "")
1896
+ {
1897
+ // NOOP
1898
+ return true;
1899
+ }
1900
+ else if (ref.substr(0, 2) == "//")
1901
+ {
1902
+ // Special case. This is an absolute URI but without the scheme.
1903
+ // Take the scheme from this URI and tack it on. This is
1904
+ // intended to make working with chdir() a little more
1905
+ // tolerant.
1906
+ var final:String = this.scheme + ":" + ref;
1907
+
1908
+ return constructURI(final);
1909
+ }
1910
+ else if (ref.charAt(0) == "?")
1911
+ {
1912
+ // A relative URI that is just a query part is essentially
1913
+ // a "./?query". We tack on the "./" here to make the rest
1914
+ // of our logic work.
1915
+ ref = "./" + ref;
1916
+ }
1917
+
1918
+ // Parse the reference passed in as a URI. This way we
1919
+ // get any query and fragments parsed out as well.
1920
+ uriReference = new URI(ref);
1921
+
1922
+ if (uriReference.isAbsolute() ||
1923
+ uriReference.isHierarchical() == false)
1924
+ {
1925
+ // If the URI given is a full URI, it replaces this one.
1926
+ copyURI(uriReference);
1927
+ return true;
1928
+ }
1929
+
1930
+
1931
+ var thisPath:String, thatPath:String;
1932
+ var thisParts:Array, thatParts:Array;
1933
+ var thisIsDir:Boolean = false, thatIsDir:Boolean = false;
1934
+ var thisIsAbs:Boolean = false, thatIsAbs:Boolean = false;
1935
+ var lastIsDotOperation:Boolean = false;
1936
+ var curDir:String;
1937
+ var i:int;
1938
+
1939
+ thisPath = this.path;
1940
+ thatPath = uriReference.path;
1941
+
1942
+ if (thisPath.length > 0)
1943
+ thisParts = thisPath.split("/");
1944
+ else
1945
+ thisParts = new Array();
1946
+
1947
+ if (thatPath.length > 0)
1948
+ thatParts = thatPath.split("/");
1949
+ else
1950
+ thatParts = new Array();
1951
+
1952
+ if (thisParts.length > 0 && thisParts[0] == "")
1953
+ {
1954
+ thisIsAbs = true;
1955
+ thisParts.shift(); // pop the first one off the array
1956
+ }
1957
+ if (thisParts.length > 0 && thisParts[thisParts.length - 1] == "")
1958
+ {
1959
+ thisIsDir = true;
1960
+ thisParts.pop(); // pop the last one off the array
1961
+ }
1962
+
1963
+ if (thatParts.length > 0 && thatParts[0] == "")
1964
+ {
1965
+ thatIsAbs = true;
1966
+ thatParts.shift(); // pop the first one off the array
1967
+ }
1968
+ if (thatParts.length > 0 && thatParts[thatParts.length - 1] == "")
1969
+ {
1970
+ thatIsDir = true;
1971
+ thatParts.pop(); // pop the last one off the array
1972
+ }
1973
+
1974
+ if (thatIsAbs)
1975
+ {
1976
+ // The reference is an absolute path (starts with a slash).
1977
+ // It replaces this path wholesale.
1978
+ this.path = uriReference.path;
1979
+
1980
+ // And it inherits the query and fragment
1981
+ this.queryRaw = uriReference.queryRaw;
1982
+ this.fragment = uriReference.fragment;
1983
+
1984
+ return true;
1985
+ }
1986
+ else if (thatParts.length == 0 && uriReference.query == "")
1987
+ {
1988
+ // The reference must have only been a fragment. Fragments just
1989
+ // get appended to whatever the current path is. We don't want
1990
+ // to overwrite any query that may already exist, so this case
1991
+ // only takes on the new fragment.
1992
+ this.fragment = uriReference.fragment;
1993
+ return true;
1994
+ }
1995
+ else if (thisIsDir == false && thisParts.length > 0)
1996
+ {
1997
+ // This path ends in a file. It goes away no matter what.
1998
+ thisParts.pop();
1999
+ }
2000
+
2001
+ // By default, this assumes the query and fragment of the reference
2002
+ this.queryRaw = uriReference.queryRaw;
2003
+ this.fragment = uriReference.fragment;
2004
+
2005
+ // Append the parts of the path from the passed in reference
2006
+ // to this object's path.
2007
+ thisParts = thisParts.concat(thatParts);
2008
+
2009
+ for(i = 0; i < thisParts.length; i++)
2010
+ {
2011
+ curDir = thisParts[i];
2012
+ lastIsDotOperation = false;
2013
+
2014
+ if (curDir == ".")
2015
+ {
2016
+ thisParts.splice(i, 1);
2017
+ i = i - 1; // account for removing this item
2018
+ lastIsDotOperation = true;
2019
+ }
2020
+ else if (curDir == "..")
2021
+ {
2022
+ if (i >= 1)
2023
+ {
2024
+ if (thisParts[i - 1] == "..")
2025
+ {
2026
+ // If the previous is a "..", we must have skipped
2027
+ // it due to this URI being relative. We can't
2028
+ // collapse leading ".."s in a relative URI, so
2029
+ // do nothing.
2030
+ }
2031
+ else
2032
+ {
2033
+ thisParts.splice(i - 1, 2);
2034
+ i = i - 2; // move back to account for the 2 we removed
2035
+ }
2036
+ }
2037
+ else
2038
+ {
2039
+ // This is the first thing in the path.
2040
+
2041
+ if (isRelative())
2042
+ {
2043
+ // We can't collapse leading ".."s in a relative
2044
+ // path. Do noting.
2045
+ }
2046
+ else
2047
+ {
2048
+ // This is an abnormal case. We have dot-dotted up
2049
+ // past the base of our "file system". This is a
2050
+ // case where we had a /path/like/this.htm and were
2051
+ // given a path to chdir to like this:
2052
+ // ../../../../../../mydir
2053
+ // Obviously, it has too many ".." and will take us
2054
+ // up beyond the top of the URI. However, according
2055
+ // RFC 2396 Appendix C.2, we should try to handle
2056
+ // these abnormal cases appropriately. In this case,
2057
+ // we will do what UNIX command lines do if you are
2058
+ // at the root (/) of the filesystem and execute:
2059
+ // # cd ../../../../../bin
2060
+ // Which will put you in /bin. Essentially, the extra
2061
+ // ".."'s will just get eaten.
2062
+
2063
+ thisParts.splice(i, 1);
2064
+ i = i - 1; // account for the ".." we just removed
2065
+ }
2066
+ }
2067
+
2068
+ lastIsDotOperation = true;
2069
+ }
2070
+ }
2071
+
2072
+ var finalPath:String = "";
2073
+
2074
+ // If the last thing in the path was a "." or "..", then this thing is a
2075
+ // directory. If the last thing isn't a dot-op, then we don't want to
2076
+ // blow away any information about the directory (hence the "|=" binary
2077
+ // assignment).
2078
+ thatIsDir = thatIsDir || lastIsDotOperation;
2079
+
2080
+ // Reconstruct the path with the abs/dir info we have
2081
+ finalPath = joinPath(thisParts, thisIsAbs, thatIsDir);
2082
+
2083
+ // Set the path (automatically escaping it)
2084
+ this.path = finalPath;
2085
+
2086
+ return true;
2087
+ }
2088
+
2089
+ /**
2090
+ * @private
2091
+ * Join an array of path parts back into a URI style path string.
2092
+ * This is used by the various path logic functions to recombine
2093
+ * a path. This is different than the standard Array.join()
2094
+ * function because we need to take into account the starting and
2095
+ * ending path delimiters if this is an absolute path or a
2096
+ * directory.
2097
+ *
2098
+ * @param parts the Array that contains strings of each path part.
2099
+ * @param isAbs true if the given path is absolute
2100
+ * @param isDir true if the given path is a directory
2101
+ *
2102
+ * @return the combined path string.
2103
+ */
2104
+ protected function joinPath(parts:Array, isAbs:Boolean, isDir:Boolean) : String
2105
+ {
2106
+ var pathStr:String = "";
2107
+ var i:int;
2108
+
2109
+ for (i = 0; i < parts.length; i++)
2110
+ {
2111
+ if (pathStr.length > 0)
2112
+ pathStr += "/";
2113
+
2114
+ pathStr += parts[i];
2115
+ }
2116
+
2117
+ // If this path is a directory, tack on the directory delimiter,
2118
+ // but only if the path contains something. Adding this to an
2119
+ // empty path would make it "/", which is an absolute path that
2120
+ // starts at the root.
2121
+ if (isDir && pathStr.length > 0)
2122
+ pathStr += "/";
2123
+
2124
+ if (isAbs)
2125
+ pathStr = "/" + pathStr;
2126
+
2127
+ return pathStr;
2128
+ }
2129
+
2130
+ /**
2131
+ * Given an absolute URI, make this relative URI absolute using
2132
+ * the given URI as a base. This URI instance must be relative
2133
+ * and the base_uri must be absolute.
2134
+ *
2135
+ * @param base_uri URI to use as the base from which to make
2136
+ * this relative URI into an absolute URI.
2137
+ *
2138
+ * @return true if successful, false otherwise.
2139
+ */
2140
+ public function makeAbsoluteURI(base_uri:URI) : Boolean
2141
+ {
2142
+ if (isAbsolute() || base_uri.isRelative())
2143
+ {
2144
+ // This URI needs to be relative, and the base needs to be
2145
+ // absolute otherwise we won't know what to do!
2146
+ return false;
2147
+ }
2148
+
2149
+ // Make a copy of the base URI. We don't want to modify
2150
+ // the passed URI.
2151
+ var base:URI = new URI();
2152
+ base.copyURI(base_uri);
2153
+
2154
+ // ChDir on the base URI. This will preserve any query
2155
+ // and fragment we have.
2156
+ if (base.chdir(toString()) == false)
2157
+ return false;
2158
+
2159
+ // It worked, so copy the base into this one
2160
+ copyURI(base);
2161
+
2162
+ return true;
2163
+ }
2164
+
2165
+
2166
+ /**
2167
+ * Given a URI to use as a base from which this object should be
2168
+ * relative to, convert this object into a relative URI. For example,
2169
+ * if you have:
2170
+ *
2171
+ * <listing>
2172
+ * var uri1:URI = new URI("http://something.com/path/to/some/file.html");
2173
+ * var uri2:URI = new URI("http://something.com/path/to/another/file.html");
2174
+ *
2175
+ * uri1.MakeRelativePath(uri2);</listing>
2176
+ *
2177
+ * <p>uri1 will have a final value of "../some/file.html"</p>
2178
+ *
2179
+ * <p>Note! This function is brute force. If you have two URI's
2180
+ * that are completely unrelated, this will still attempt to make
2181
+ * the relative URI. In that case, you will most likely get a
2182
+ * relative path that looks something like:</p>
2183
+ *
2184
+ * <p>../../../../../../some/path/to/my/file.html</p>
2185
+ *
2186
+ * @param base_uri the URI from which to make this URI relative
2187
+ *
2188
+ * @return true if successful, false if the base_uri and this URI
2189
+ * are not related, of if error.
2190
+ */
2191
+ public function makeRelativeURI(base_uri:URI, caseSensitive:Boolean = true) : Boolean
2192
+ {
2193
+ var base:URI = new URI();
2194
+ base.copyURI(base_uri);
2195
+
2196
+ var thisParts:Array, thatParts:Array;
2197
+ var finalParts:Array = new Array();
2198
+ var thisPart:String, thatPart:String, finalPath:String;
2199
+ var pathStr:String = this.path;
2200
+ var queryStr:String = this.queryRaw;
2201
+ var fragmentStr:String = this.fragment;
2202
+ var i:int;
2203
+ var diff:Boolean = false;
2204
+ var isDir:Boolean = false;
2205
+
2206
+ if (isRelative())
2207
+ {
2208
+ // We're already relative.
2209
+ return true;
2210
+ }
2211
+
2212
+ if (base.isRelative())
2213
+ {
2214
+ // The base is relative. A relative base doesn't make sense.
2215
+ return false;
2216
+ }
2217
+
2218
+
2219
+ if ( (isOfType(base_uri.scheme) == false) ||
2220
+ (this.authority != base_uri.authority) )
2221
+ {
2222
+ // The schemes and/or authorities are different. We can't
2223
+ // make a relative path to something that is completely
2224
+ // unrelated.
2225
+ return false;
2226
+ }
2227
+
2228
+ // Record the state of this URI
2229
+ isDir = isDirectory();
2230
+
2231
+ // We are based of the directory of the given URI. We need to
2232
+ // make sure the URI is pointing to a directory. Changing
2233
+ // directory to "." will remove any file name if the base is
2234
+ // not a directory.
2235
+ base.chdir(".");
2236
+
2237
+ thisParts = pathStr.split("/");
2238
+ thatParts = base.path.split("/");
2239
+
2240
+ if (thisParts.length > 0 && thisParts[0] == "")
2241
+ thisParts.shift();
2242
+
2243
+ if (thisParts.length > 0 && thisParts[thisParts.length - 1] == "")
2244
+ {
2245
+ isDir = true;
2246
+ thisParts.pop();
2247
+ }
2248
+
2249
+ if (thatParts.length > 0 && thatParts[0] == "")
2250
+ thatParts.shift();
2251
+ if (thatParts.length > 0 && thatParts[thatParts.length - 1] == "")
2252
+ thatParts.pop();
2253
+
2254
+
2255
+ // Now that we have the paths split into an array of directories,
2256
+ // we can compare the two paths. We start from the left of side
2257
+ // of the path and start comparing. When we either run out of
2258
+ // directories (one path is longer than the other), or we find
2259
+ // a directory that is different, we stop. The remaining parts
2260
+ // of each path is then used to determine the relative path. For
2261
+ // example, lets say we have:
2262
+ // path we want to make relative: /a/b/c/d/e.txt
2263
+ // path to use as base for relative: /a/b/f/
2264
+ //
2265
+ // This loop will start at the left, and remove directories
2266
+ // until we get a mismatch or run off the end of one of them.
2267
+ // In this example, the result will be:
2268
+ // c/d/e.txt
2269
+ // f
2270
+ //
2271
+ // For every part left over in the base path, we prepend a ".."
2272
+ // to the relative to get the final path:
2273
+ // ../c/d/e.txt
2274
+ while(thatParts.length > 0)
2275
+ {
2276
+ if (thisParts.length == 0)
2277
+ {
2278
+ // we matched all there is to match, we are done.
2279
+ // This is the case where "this" object is a parent
2280
+ // path of the given URI. eg:
2281
+ // this.path = /a/b/ (thisParts)
2282
+ // base.path = /a/b/c/d/e/ (thatParts)
2283
+ break;
2284
+ }
2285
+
2286
+ thisPart = thisParts[0];
2287
+ thatPart = thatParts[0];
2288
+
2289
+ if (compareStr(thisPart, thatPart, caseSensitive))
2290
+ {
2291
+ thisParts.shift();
2292
+ thatParts.shift();
2293
+ }
2294
+ else
2295
+ break;
2296
+ }
2297
+
2298
+ // If there are any path info left from the base URI, that means
2299
+ // **this** object is above the given URI in the file tree. For
2300
+ // each part left over in the given URI, we need to move up one
2301
+ // directory to get where we are.
2302
+ var dotdot:String = "..";
2303
+ for (i = 0; i < thatParts.length; i++)
2304
+ {
2305
+ finalParts.push(dotdot);
2306
+ }
2307
+
2308
+ // Append the parts of this URI to any dot-dot's we have
2309
+ finalParts = finalParts.concat(thisParts);
2310
+
2311
+ // Join the parts back into a path
2312
+ finalPath = joinPath(finalParts, false /* not absolute */, isDir);
2313
+
2314
+ if (finalPath.length == 0)
2315
+ {
2316
+ // The two URI's are exactly the same. The proper relative
2317
+ // path is:
2318
+ finalPath = "./";
2319
+ }
2320
+
2321
+ // Set the parts of the URI, preserving the original query and
2322
+ // fragment parts.
2323
+ setParts("", "", "", finalPath, queryStr, fragmentStr);
2324
+
2325
+ return true;
2326
+ }
2327
+
2328
+ /**
2329
+ * Given a string, convert it to a URI. The string could be a
2330
+ * full URI that is improperly escaped, a malformed URI (e.g.
2331
+ * missing a protocol like "www.something.com"), a relative URI,
2332
+ * or any variation there of.
2333
+ *
2334
+ * <p>The intention of this function is to take anything that a
2335
+ * user might manually enter as a URI/URL and try to determine what
2336
+ * they mean. This function differs from the URI constructor in
2337
+ * that it makes some assumptions to make it easy to import user
2338
+ * entered URI data.</p>
2339
+ *
2340
+ * <p>This function is intended to be a helper function.
2341
+ * It is not all-knowning and will probably make mistakes
2342
+ * when attempting to parse a string of unknown origin. If
2343
+ * your applicaiton is receiving input from the user, your
2344
+ * application should already have a good idea what the user
2345
+ * should be entering, and your application should be
2346
+ * pre-processing the user's input to make sure it is well formed
2347
+ * before passing it to this function.</p>
2348
+ *
2349
+ * <p>It is assumed that the string given to this function is
2350
+ * something the user may have manually entered. Given this,
2351
+ * the URI string is probably unescaped or improperly escaped.
2352
+ * This function will attempt to properly escape the URI by
2353
+ * using forceEscape(). The result is that a toString() call
2354
+ * on a URI that was created from unknownToURI() may not match
2355
+ * the input string due to the difference in escaping.</p>
2356
+ *
2357
+ * @param unknown a potental URI string that should be parsed
2358
+ * and loaded into this object.
2359
+ * @param defaultScheme if it is determined that the passed string
2360
+ * looks like a URI, but it is missing the scheme part, this
2361
+ * string will be used as the missing scheme.
2362
+ *
2363
+ * @return true if the given string was successfully parsed into
2364
+ * a valid URI object, false otherwise.
2365
+ */
2366
+ public function unknownToURI(unknown:String, defaultScheme:String = "http") : Boolean
2367
+ {
2368
+ var temp:String;
2369
+
2370
+ if (unknown.length == 0)
2371
+ {
2372
+ this.initialize();
2373
+ return false;
2374
+ }
2375
+
2376
+ // Some users love the backslash key. Fix it.
2377
+ unknown = unknown.replace(/\\/g, "/");
2378
+
2379
+ // Check for any obviously missing scheme.
2380
+ if (unknown.length >= 2)
2381
+ {
2382
+ temp = unknown.substr(0, 2);
2383
+ if (temp == "//")
2384
+ unknown = defaultScheme + ":" + unknown;
2385
+ }
2386
+
2387
+ if (unknown.length >= 3)
2388
+ {
2389
+ temp = unknown.substr(0, 3);
2390
+ if (temp == "://")
2391
+ unknown = defaultScheme + unknown;
2392
+ }
2393
+
2394
+ // Try parsing it as a normal URI
2395
+ var uri:URI = new URI(unknown);
2396
+
2397
+ if (uri.isHierarchical() == false)
2398
+ {
2399
+ if (uri.scheme == UNKNOWN_SCHEME)
2400
+ {
2401
+ this.initialize();
2402
+ return false;
2403
+ }
2404
+
2405
+ // It's a non-hierarchical URI
2406
+ copyURI(uri);
2407
+ forceEscape();
2408
+ return true;
2409
+ }
2410
+ else if ((uri.scheme != UNKNOWN_SCHEME) &&
2411
+ (uri.scheme.length > 0))
2412
+ {
2413
+ if ( (uri.authority.length > 0) ||
2414
+ (uri.scheme == "file") )
2415
+ {
2416
+ // file://... URI
2417
+ copyURI(uri);
2418
+ forceEscape(); // ensure proper escaping
2419
+ return true;
2420
+ }
2421
+ else if (uri.authority.length == 0 && uri.path.length == 0)
2422
+ {
2423
+ // It's is an incomplete URI (eg "http://")
2424
+
2425
+ setParts(uri.scheme, "", "", "", "", "");
2426
+ return false;
2427
+ }
2428
+ }
2429
+ else
2430
+ {
2431
+ // Possible relative URI. We can only detect relative URI's
2432
+ // that start with "." or "..". If it starts with something
2433
+ // else, the parsing is ambiguous.
2434
+ var path:String = uri.path;
2435
+
2436
+ if (path == ".." || path == "." ||
2437
+ (path.length >= 3 && path.substr(0, 3) == "../") ||
2438
+ (path.length >= 2 && path.substr(0, 2) == "./") )
2439
+ {
2440
+ // This is a relative URI.
2441
+ copyURI(uri);
2442
+ forceEscape();
2443
+ return true;
2444
+ }
2445
+ }
2446
+
2447
+ // Ok, it looks like we are just a normal URI missing the scheme. Tack
2448
+ // on the scheme.
2449
+ uri = new URI(defaultScheme + "://" + unknown);
2450
+
2451
+ // Check to see if we are good now
2452
+ if (uri.scheme.length > 0 && uri.authority.length > 0)
2453
+ {
2454
+ // It was just missing the scheme.
2455
+ copyURI(uri);
2456
+ forceEscape(); // Make sure we are properly encoded.
2457
+ return true;
2458
+ }
2459
+
2460
+ // don't know what this is
2461
+ this.initialize();
2462
+ return false;
2463
+ }
2464
+
2465
+ } // end URI class
2466
+ } // end package