test_class.file: fluxtream-connectors/src/test/java/org/fluxtream/connectors/google_latitude/GoogleLatitudeUpdaterTest.java
test_class.identifier: GoogleLatitudeUpdaterTest
test_case.body: @Test
      public void testImportFile() throws Exception {
  //        GoogleLatitudeUpdater updater = new GoogleLatitudeUpdater();
  //        //final InputStream resourceAsStream = GoogleLatitudeUpdaterTest.class.getResourceAsStream("/locationhistory-unwrapped.zip");
  //        final InputStream resourceAsStream = GoogleLatitudeUpdaterTest.class.getResourceAsStream("/locationhistory-wrapped.zip");
  //        final File file = File.createTempFile("resource", ".temp");
  //        IOUtils.copy(resourceAsStream, new FileOutputStream(file));
  //        final int imported = updater.importFile(null, file);
  //        assertTrue(imported==88);
      }
test_case.class_method_signature: GoogleLatitudeUpdaterTest.testImportFile()
test_case.full_signature: @Test public void testImportFile()
test_case.identifier: testImportFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testImportFile()
focal_class.declarator: logger = FlxLogger.getLogger(GoogleLatitudeUpdater.class)
focal_class.original_string: FlxLogger logger = FlxLogger.getLogger(GoogleLatitudeUpdater.class);
focal_class.type: FlxLogger
focal_class.var_name: logger
focal_class.declarator: apiDataService
focal_class.modifier: @Autowired
focal_class.original_string: @Autowired
      ApiDataService apiDataService;
focal_class.type: ApiDataService
focal_class.var_name: apiDataService
focal_class.file: fluxtream-connectors/src/main/java/org/fluxtream/connectors/google_latitude/GoogleLatitudeUpdater.java
focal_class.identifier: GoogleLatitudeUpdater
focal_class.interfaces: implements FileUploadSupport
focal_class.class_method_signature: GoogleLatitudeUpdater.GoogleLatitudeUpdater()
focal_class.full_signature: public  GoogleLatitudeUpdater()
focal_class.identifier: GoogleLatitudeUpdater
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  GoogleLatitudeUpdater()
focal_class.class_method_signature: GoogleLatitudeUpdater.updateConnectorDataHistory(UpdateInfo updateInfo)
focal_class.full_signature: @Override public void updateConnectorDataHistory(UpdateInfo updateInfo)
focal_class.identifier: updateConnectorDataHistory
focal_class.modifiers: @Override public
focal_class.parameters: (UpdateInfo updateInfo)
focal_class.return: void
focal_class.signature: void updateConnectorDataHistory(UpdateInfo updateInfo)
focal_class.class_method_signature: GoogleLatitudeUpdater.updateConnectorData(UpdateInfo updateInfo)
focal_class.full_signature: public void updateConnectorData(UpdateInfo updateInfo)
focal_class.identifier: updateConnectorData
focal_class.modifiers: public
focal_class.parameters: (UpdateInfo updateInfo)
focal_class.return: void
focal_class.signature: void updateConnectorData(UpdateInfo updateInfo)
focal_class.class_method_signature: GoogleLatitudeUpdater.setDefaultChannelStyles(ApiKey apiKey)
focal_class.full_signature: @Override public void setDefaultChannelStyles(ApiKey apiKey)
focal_class.identifier: setDefaultChannelStyles
focal_class.modifiers: @Override public
focal_class.parameters: (ApiKey apiKey)
focal_class.return: void
focal_class.signature: void setDefaultChannelStyles(ApiKey apiKey)
focal_class.class_method_signature: GoogleLatitudeUpdater.sendServiceDiscontinuedWarning(final UpdateInfo updateInfo)
focal_class.full_signature: private void sendServiceDiscontinuedWarning(final UpdateInfo updateInfo)
focal_class.identifier: sendServiceDiscontinuedWarning
focal_class.modifiers: private
focal_class.parameters: (final UpdateInfo updateInfo)
focal_class.return: void
focal_class.signature: void sendServiceDiscontinuedWarning(final UpdateInfo updateInfo)
focal_class.class_method_signature: GoogleLatitudeUpdater.cleanupOldTokens(final UpdateInfo updateInfo)
focal_class.full_signature: private void cleanupOldTokens(final UpdateInfo updateInfo)
focal_class.identifier: cleanupOldTokens
focal_class.modifiers: private
focal_class.parameters: (final UpdateInfo updateInfo)
focal_class.return: void
focal_class.signature: void cleanupOldTokens(final UpdateInfo updateInfo)
focal_class.class_method_signature: GoogleLatitudeUpdater.importFile(final ApiKey apiKey, final File f)
focal_class.full_signature: @Override public int importFile(final ApiKey apiKey, final File f)
focal_class.identifier: importFile
focal_class.modifiers: @Override public
focal_class.parameters: (final ApiKey apiKey, final File f)
focal_class.return: int
focal_class.signature: int importFile(final ApiKey apiKey, final File f)
focal_class.class_method_signature: GoogleLatitudeUpdater.parseLocations(final ApiKey apiKey, final InputStream inputStream)
focal_class.full_signature: private int parseLocations(final ApiKey apiKey, final InputStream inputStream)
focal_class.identifier: parseLocations
focal_class.modifiers: private
focal_class.parameters: (final ApiKey apiKey, final InputStream inputStream)
focal_class.return: int
focal_class.signature: int parseLocations(final ApiKey apiKey, final InputStream inputStream)
focal_class.class_method_signature: GoogleLatitudeUpdater.persistLocations(ApiKey apiKey, List<LocationFacet> locations)
focal_class.full_signature: private boolean persistLocations(ApiKey apiKey, List<LocationFacet> locations)
focal_class.identifier: persistLocations
focal_class.modifiers: private
focal_class.parameters: (ApiKey apiKey, List<LocationFacet> locations)
focal_class.return: boolean
focal_class.signature: boolean persistLocations(ApiKey apiKey, List<LocationFacet> locations)
focal_class.class_method_signature: GoogleLatitudeUpdater.getToLocationData(final JsonParser jParser)
focal_class.full_signature: private void getToLocationData(final JsonParser jParser)
focal_class.identifier: getToLocationData
focal_class.modifiers: private
focal_class.parameters: (final JsonParser jParser)
focal_class.return: void
focal_class.signature: void getToLocationData(final JsonParser jParser)
focal_class.class_method_signature: GoogleLatitudeUpdater.parseLocation(final ApiKey apiKey, final JsonParser jParser, final List<LocationFacet> locations)
focal_class.full_signature:  void parseLocation(final ApiKey apiKey, final JsonParser jParser, final List<LocationFacet> locations)
focal_class.identifier: parseLocation
focal_class.parameters: (final ApiKey apiKey, final JsonParser jParser, final List<LocationFacet> locations)
focal_class.return: void
focal_class.signature: void parseLocation(final ApiKey apiKey, final JsonParser jParser, final List<LocationFacet> locations)
focal_class.superclass: extends AbstractUpdater
focal_method.body: @Override
      public int importFile(final ApiKey apiKey, final File f) throws Exception {
          try {
              ZipFile zipFile = new ZipFile(f);
              final Enumeration<? extends ZipEntry> entries = zipFile.entries();
              while (entries.hasMoreElements()) {
                  final ZipEntry zipEntry = entries.nextElement();
                  if (zipEntry.isDirectory()) continue;
                  if (zipEntry.getName().endsWith("LocationHistory.json"))
                      return parseLocations(apiKey, zipFile.getInputStream(zipEntry));
              }
              throw new RuntimeException("Couldn't find LocationHistory.json in the uploaded zip file");
          }
          catch (Exception e) {
              notificationsService.addNamedNotification(apiKey.getGuestId(), Notification.Type.WARNING, connector().statusNotificationName(),
                                                        "Failed to import Google Latitude zip file, error is:<br>" +
                                                        e.getMessage());
              throw (e);
          }
      }
focal_method.class_method_signature: GoogleLatitudeUpdater.importFile(final ApiKey apiKey, final File f)
focal_method.full_signature: @Override public int importFile(final ApiKey apiKey, final File f)
focal_method.identifier: importFile
focal_method.invocations: entries hasMoreElements nextElement isDirectory endsWith getName parseLocations getInputStream addNamedNotification getGuestId statusNotificationName connector getMessage
focal_method.modifiers: @Override public
focal_method.parameters: (final ApiKey apiKey, final File f)
focal_method.return: int
focal_method.signature: int importFile(final ApiKey apiKey, final File f)