APISonar


org.loklak.data.DAO.log

> org > loklak > data > DAO > log
org APIs loklak APIs data APIs DAO APIs log APIs

Example 1
public static void upgrade() {
        final File upgradeScript = new File(DAO.bin_dir.getAbsolutePath().replaceAll(" ", "\\ "), "upgrade.sh");
      
        try {
            List<String> rsp = OS.execSynchronous(upgradeScript.getAbsolutePath());
            for (String s: rsp) DAO.log("UPGRADE: " + s);
        } catch (IOException e) {
        	DAO.severe("UPGRADE failed: " + e.getMessage(), e);
        }
    }
Example 2
public void parseFromInputStreamTest() throws IOException {
        YoutubeScraper ytubeScrape = new YoutubeScraper();
        String url = "https://www.youtube.com/watch?v=KVGRN7Z7T1A";
        InputStream fis = null;

        try {
            fis = new URL(url).openStream();
            Post video = ytubeScrape.parseVideo(fis, "url", url);
            DAO.log(video.toString());
            assertThat(video.get("html_title").toString(), is("[\"Iggy Azalea - Team (Official Music Video) - YouTube\"]"));
        } catch (IOException e) {
            DAO.log("YoutubeScraperTest.parseFromInputStreamTest() failed to connect to network. url:" + url);
        }

    }
Example 3
protected String prepareSearchUrl(String type) {
        URIBuilder url = null;
        try {
            url = new URIBuilder(this.baseUrl + this.query);
        } catch (URISyntaxException e) {
            DAO.log("Invalid Url: baseUrl = " + this.baseUrl + ", mid-URL = " + midUrl + "query = " + this.query + "type = " + type);
            return "";
        }

        return url.toString();
    }
Example 4
public DateTime getTimestampDate(String a) {
        DAO.log("date is " + String.valueOf(this.getTimestamp()) + "    " + String.valueOf(new Date(this.getTimestamp())));
        return new DateTime(this.getTimestamp(), DateTimeZone.UTC);
    }
Example 5
public void publish(String channel, String message) {
        channel = channel.replaceAll("#", "");
        DAO.log("Publishing " + message.substring(0, 10) + " to " + channel);
        MqttMessage msg = new MqttMessage(message.getBytes());
        msg.setQos(this.qos);
        try {
            this.client.publish(channel, msg);
        } catch (MqttException e) {
            DAO.severe("Failed to publish message to channel " + channel + " due to MQTT exception", e);
        } catch (IllegalArgumentException e) {
            DAO.severe("Failed to publish message to channel " + channel + " because of invalid channel name", e);
        } catch (Exception e) {
            DAO.severe("Failed to publish message to channel " + channel + " due to unknown exception", e);
        }
    }
Example 6
private void pushToBackend(TwitterTimeline timeline) {
        DAO.log("Pushing " + timeline.size() + " to backend ..." );
        executorService.execute(new PushThread(BACKEND, timeline));
    }