Пример #1
0
 protected InputStream httpPostQueryStream(final AbsURL url) throws DataSyncerException {
   final NetworkClient client = NetworkClient.getInstance();
   if (url.isAuthNeeded()) {
     final String auth = ReaderAccountMgr.getInstance().blockingGetAuth();
     client.setAuth(auth);
   }
   try {
     return NetworkClient.getInstance().doPostStream(url.getURL(), url.getParamsString());
   } catch (final IOException exception) {
     throw new DataSyncerException(exception);
   } catch (final NetworkException exception) {
     throw new DataSyncerException(exception);
   }
 }
Пример #2
0
 protected byte[] httpGetQueryByte(final AbsURL url) throws DataSyncerException {
   final NetworkClient client = NetworkClient.getInstance();
   if (url.isAuthNeeded()) {
     final String auth = ReaderAccountMgr.getInstance().blockingGetAuth();
     client.setAuth(auth);
   }
   try {
     String rUrl = url.getURL();
     final String param = url.getParamsString();
     if (param.length() > 0) {
       rUrl += "?" + param;
     }
     return client.doGetByte(rUrl);
   } catch (final Exception e) {
     throw new DataSyncerException(e);
   }
 }