OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library appengine.appengine_context; |
| 6 |
| 7 import 'server/assets.dart'; |
| 8 |
| 9 class AppengineContext { |
| 10 final String applicationID; |
| 11 final String partition; |
| 12 final String version; |
| 13 final String module; |
| 14 final String instance; |
| 15 final AssetsManager assets; |
| 16 |
| 17 AppengineContext(String partition, this.applicationID, this.version, |
| 18 this.module, this.instance, Uri pubServeUrl) |
| 19 : partition = partition, |
| 20 assets = new AssetsManager(pubServeUrl, partition == 'dev'); |
| 21 |
| 22 bool get isDevelopmentEnvironment => partition == 'dev'; |
| 23 |
| 24 String get fullQualifiedApplicationId => '$partition~$applicationID'; |
| 25 |
| 26 String get backgroundTicket { |
| 27 var majorVersion = version.split('_')[0]; |
| 28 var escapedApplicationID = |
| 29 applicationID.replaceAll(':', '_').replaceAll('.', '_'); |
| 30 |
| 31 return '$escapedApplicationID/$module.$majorVersion.$instance'; |
| 32 } |
| 33 } |
OLD | NEW |