Package com.google.api.client.util

Examples of com.google.api.client.util.DateTime


    private static Event newEvent() {
      Event event = new Event();
      event.setSummary("New Event");
      Date startDate = new Date();
      Date endDate = new Date(startDate.getTime() + 3600000);
      DateTime start = new DateTime(startDate, TimeZone.getTimeZone("UTC"));
      event.setStart(new EventDateTime().setDateTime(start));
      DateTime end = new DateTime(endDate, TimeZone.getTimeZone("UTC"));
      event.setEnd(new EventDateTime().setDateTime(end));
      return event;
    }
View Full Code Here


                rd.setDenyACL(denyAclArray);
              }

              // Now do standard stuff
              String mimeType = googleFile.getMimeType();
              DateTime createdDate = googleFile.getCreatedDate();
              DateTime modifiedDate = googleFile.getModifiedDate();
              String extension = googleFile.getFileExtension();
              String title = googleFile.getTitle();
             
              if (mimeType != null)
                rd.setMimeType(mimeType);
              if (createdDate != null)
                rd.setCreatedDate(new Date(createdDate.getValue()));
              if (modifiedDate != null)
                rd.setModifiedDate(new Date(modifiedDate.getValue()));
              if (extension != null)
              {
                if (title == null)
                  title = "";
                rd.setFileName(title + "." + extension);
View Full Code Here

                rd.setDenyACL(denyAclArray);
              }

              // Now do standard stuff
              String mimeType = googleFile.getMimeType();
              DateTime createdDate = googleFile.getCreatedDate();
              DateTime modifiedDate = googleFile.getModifiedDate();
              String extension = googleFile.getFileExtension();
              String title = googleFile.getTitle();
             
              if (mimeType != null)
                rd.setMimeType(mimeType);
              if (createdDate != null)
                rd.setCreatedDate(new Date(createdDate.getValue()));
              if (modifiedDate != null)
                rd.setModifiedDate(new Date(modifiedDate.getValue()));
              if (extension != null)
              {
                if (title == null)
                  title = "";
                rd.setFileName(title + "." + extension);
View Full Code Here

                rd.setDenyACL(denyAclArray);
              }

              // Now do standard stuff
              String mimeType = googleFile.getMimeType();
              DateTime createdDate = googleFile.getCreatedDate();
              DateTime modifiedDate = googleFile.getModifiedDate();
              String extension = googleFile.getFileExtension();
              String title = googleFile.getTitle();
             
              if (mimeType != null)
                rd.setMimeType(mimeType);
              if (createdDate != null)
                rd.setCreatedDate(new Date(createdDate.getValue()));
              if (modifiedDate != null)
                rd.setModifiedDate(new Date(modifiedDate.getValue()));
              if (extension != null)
              {
                if (title == null)
                  title = "";
                rd.setFileName(title + "." + extension);
View Full Code Here

    }
    return token;
  }

  public static Date convertStringToDateTimeInRFC3339(String dateStr) {
    DateTime dt = DateTime.parseRfc3339(dateStr);
    return new Date(dt.getValue());
  }
View Full Code Here

    DateTime dt = DateTime.parseRfc3339(dateStr);
    return new Date(dt.getValue());
  }

  public static String convertDateToStringInRFC3339(Date date) {
    DateTime dt = new DateTime(date.getTime(), 480);
    String wholeFormat = dt.toString();
    //Do a little hack here for converting the date into the proper string
    String result = wholeFormat.substring(0, wholeFormat.indexOf(".")) + wholeFormat.substring(wholeFormat.indexOf(".") + 4);
    return result;
  }
View Full Code Here

    }

    @Test
    public void testTouch() throws Exception {
        File theTestFile = uploadTestFile();
        DateTime createdDate = theTestFile.getModifiedDate();
        // using String message body for single parameter "fileId"
        File result = requestBody("direct://TOUCH", theTestFile.getId());

        assertNotNull("touch result", result);
        assertTrue(result.getModifiedDate().getValue() > createdDate.getValue());
    }
View Full Code Here

            final String uriTemplate = eventsApiCall.getUriTemplate();
            try {
                eventsApiCall.setPageToken(pageToken);
                eventsApiCall.setShowHiddenInvitations(true);
                eventsApiCall.setSingleEvents(true);
                eventsApiCall.setTimeMax(new DateTime(System.currentTimeMillis()));
                eventsApiCall.setUpdatedMin(new DateTime(since));
                final Events events = eventsApiCall.execute();
                countSuccessfulApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, uriTemplate);
                final List<Event> eventList = events.getItems();
                storeEvents(updateInfo, calendarEntry, eventList);
                pageToken = events.getNextPageToken();
View Full Code Here

            final String uriTemplate = eventsApiCall.getUriTemplate();
            try {
                eventsApiCall.setPageToken(pageToken);
                eventsApiCall.setShowHiddenInvitations(true);
                eventsApiCall.setSingleEvents(true);
                eventsApiCall.setTimeMax(new DateTime(System.currentTimeMillis()));
                if (since!=null)
                    eventsApiCall.setTimeMin(new DateTime(since));
                final Events events = eventsApiCall.execute();
                countSuccessfulApiCall(updateInfo.apiKey, updateInfo.objectTypes, then, uriTemplate);
                final List<Event> eventList = events.getItems();
                storeEvents(updateInfo, calendarEntry, eventList);
                pageToken = events.getNextPageToken();
View Full Code Here

            // Create a snippet with the title and scheduled start and end
            // times for the broadcast. Currently, those times are hard-coded.
            LiveBroadcastSnippet broadcastSnippet = new LiveBroadcastSnippet();
            broadcastSnippet.setTitle(title);
            broadcastSnippet.setScheduledStartTime(new DateTime("2024-01-30T00:00:00.000Z"));
            broadcastSnippet.setScheduledEndTime(new DateTime("2024-01-31T00:00:00.000Z"));

            // Set the broadcast's privacy status to "private". See:
            // https://developers.google.com/youtube/v3/live/docs/liveBroadcasts#status.privacyStatus
            LiveBroadcastStatus status = new LiveBroadcastStatus();
            status.setPrivacyStatus("private");
View Full Code Here

TOP

Related Classes of com.google.api.client.util.DateTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.