Example usage for java.text DateFormat setTimeZone

List of usage examples for java.text DateFormat setTimeZone

Introduction

In this page you can find the example usage for java.text DateFormat setTimeZone.

Prototype

public void setTimeZone(TimeZone zone) 

Source Link

Document

Sets the time zone for the calendar of this DateFormat object.

Usage

From source file:org.kalypso.ogc.sensor.adapter.NativeObservationCSVAdapter.java

@Override
protected List<NativeObservationDataSet> parse(final File source, final TimeZone timeZone,
        final boolean continueWithErrors, final IStatusCollector stati)
        throws FileNotFoundException, IOException {
    final List<NativeObservationDataSet> datasets = new ArrayList<>();

    final DateFormat sdf2 = new SimpleDateFormat("dd MM yy HH mm"); //$NON-NLS-1$
    sdf2.setTimeZone(timeZone);

    final DateFormat sdf4 = new SimpleDateFormat("dd MM yyyy HH mm"); //$NON-NLS-1$
    sdf4.setTimeZone(timeZone);//from   www.j a va  2 s  . co  m

    final char separator = ';';

    try (final FileReader fileReader = new FileReader(source);
            final LineNumberReader reader = new LineNumberReader(fileReader);
            final CSVReader csv = new CSVReader(reader, separator)) {
        String[] lineIn = null;
        while (ArrayUtils.isNotEmpty(lineIn = csv.readNext())) {
            if (!continueWithErrors && getErrorCount() > getMaxErrorCount())
                return datasets;

            final int lineNumber = reader.getLineNumber();

            try {
                readLine(stati, datasets, sdf2, sdf4, separator, lineIn, lineNumber);
            } catch (final Exception e) {
                stati.add(IStatus.ERROR, String.format(Messages.getString("NativeObservationCSVAdapter_2"), //$NON-NLS-1$
                        lineNumber, e.getLocalizedMessage()));
                tickErrorCount();
            }
        }
    }

    return datasets;
}

From source file:com.parse.ParseObjectCurrentCoderTest.java

@Test
public void testObjectSerializationFormat() throws Exception {
    ParseObject childObject = new ParseObject("child");
    childObject.setObjectId("childObjectId");

    DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
    format.setTimeZone(new SimpleTimeZone(0, "GMT"));

    String dateString = "2011-08-12T01:06:05Z";
    Date date = format.parse(dateString);

    String jsonString = "{" + "'id':'wnAiJVI3ra'," + "'updated_at':'" + dateString + "',"
            + "'pointers':{'child':['child','" + childObject.getObjectId() + "']}," + "'classname':'myClass',"
            + "'dirty':true," + "'data':{'foo':'bar'}," + "'created_at':'2011-08-12T01:06:05Z',"
            + "'deletedKeys':['toDelete']" + "}";

    ParseObjectCurrentCoder coder = ParseObjectCurrentCoder.get();
    JSONObject json = new JSONObject(jsonString);
    ParseObject.State state = coder.decode(new ParseObject.State.Builder("Test"), json, ParseDecoder.get())
            .build();//  ww w .  j  a  v  a  2s  .  c  o m

    assertEquals("wnAiJVI3ra", state.objectId());
    assertEquals("bar", state.get("foo"));
    assertEquals(date.getTime(), state.createdAt());
    assertEquals(((ParseObject) state.get("child")).getObjectId(), childObject.getObjectId());

    // Test that objects can be serialized and deserialized without timestamps
    String jsonStringWithoutTimestamps = "{" + "'id':'wnAiJVI3ra'," + "'pointers':{'child':['child','"
            + childObject.getObjectId() + "']}," + "'classname':'myClass'," + "'dirty':true,"
            + "'data':{'foo':'bar'}," + "'deletedKeys':['toDelete']" + "}";

    json = new JSONObject(jsonStringWithoutTimestamps);
    state = coder.decode(new ParseObject.State.Builder("Test"), json, ParseDecoder.get()).build();
    assertEquals("wnAiJVI3ra", state.objectId());
}

From source file:ru.timakden.yacer2.MainFragment.java

/**
 *  ListView ?   .//ww  w  .  j  a v  a  2 s  .  c o  m
 */
public void populateList() {
    DaoSession daoSession = ((YacerApplication) getActivity().getApplicationContext()).getDaoSession();
    ExchangeRateDao exchangeRateDao = daoSession.getExchangeRateDao();

    //  ?  ? ?
    long date = 0;
    try {
        date = exchangeRateDao.queryBuilder().limit(1).distinct().orderDesc(ExchangeRateDao.Properties.Date)
                .unique().getDate();
    } catch (Exception e) {
        Log.e(LOG_TAG, "Error Message: " + e.getMessage(), e);
    }

    //  ?? ?
    String rawSql = ", CURRENCY C WHERE T.DATE = ? AND C._ID = T.CURRENCY_ID ORDER BY C.SORT_ORDER ASC";
    List<ExchangeRate> exchangeRates = exchangeRateDao.queryRawCreate(rawSql, date).list();

    if (exchangeRates.size() == 0) {
        Toast.makeText(getActivity(), R.string.populate_list_failed, Toast.LENGTH_SHORT).show();
    } else {
        AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity();
        ActionBar supportActionBar = appCompatActivity.getSupportActionBar();
        if (supportActionBar != null) {
            //  ??   ? UTC,       UTC
            long dateInMilliseconds = TimeUnit.SECONDS.toMillis(exchangeRates.get(0).getDate());
            DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.FULL);
            dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

            String dateString = dateFormat.format(new Date(dateInMilliseconds));
            supportActionBar.setSubtitle(dateString);
        }

        RecyclerView recyclerView = (RecyclerView) getActivity().findViewById(R.id.recycler_view);
        recyclerView.setHasFixedSize(true);

        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
        recyclerView.setLayoutManager(linearLayoutManager);

        ExchangeRateAdapter exchangeRateAdapter = new ExchangeRateAdapter(exchangeRates, getActivity());
        recyclerView.setAdapter(exchangeRateAdapter);
    }

    if (swipeRefreshLayout.isRefreshing()) {
        swipeRefreshLayout.setRefreshing(false);
    }
}

From source file:com.profesorfalken.payzen.webservices.sdk.handler.soap.HeaderHandler.java

/**
 * Takes the outgoing SOAP message and modifies it adding the header 
 * information//from   w  w w .  j  a va 2  s  .co  m
 * 
 * @param smc SOAP message context
 * @return 
 */
@Override
public boolean handleMessage(SOAPMessageContext smc) {

    Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

    if (Boolean.TRUE.equals(outboundProperty)) {

        SOAPMessage message = smc.getMessage();

        try {
            SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();

            //Creates header into SOAP envelope
            SOAPHeader header = envelope.getHeader();
            if (header == null) {
                header = envelope.addHeader();
            }

            // Add shopId
            addHeaderField(header, "shopId", this.shopId);

            // Timestamp
            TimeZone tz = TimeZone.getTimeZone("UTC");
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
            df.setTimeZone(tz);
            String nowAsISO = df.format(new Date());
            addHeaderField(header, "timestamp", nowAsISO);

            // Mode
            addHeaderField(header, "mode", this.mode);

            // Add requestId
            String requestId = UUID.randomUUID().toString();
            addHeaderField(header, "requestId", requestId);

            // Authentication token
            String tokenString = requestId + nowAsISO;
            addHeaderField(header, "authToken", sign(tokenString, shopKey));

        } catch (SOAPException e) {
            logger.error("Error sending header", e);
        }
    }

    return outboundProperty;

}

From source file:org.openecomp.sdnc.filters.LogFilter.java

private String asIso8601(Date date) {
    TimeZone tz = TimeZone.getTimeZone("UTC");
    DateFormat df = new SimpleDateFormat("yyy-MM-dd'T'hh:mm:ss:SS'+00:00'");
    df.setTimeZone(tz);
    return df.format(date);
}

From source file:org.wso2.carbon.analytics.apim.spark.udf.APIManagerAnalyticsUDF.java

/**
 * @param dateString/*w  w w .  j  a  v  a  2s  .c  o  m*/
 * @return
 * @throws APIManagerAnalyticsUDFException
 */
public Long convertToTimestamp(String dateString) throws APIManagerAnalyticsUDFException {
    if (dateString == null) {
        throw new APIManagerAnalyticsUDFException("dateString can't be null");
    }

    DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
    format.setTimeZone(TimeZone.getTimeZone("UTC"));
    Date date = null;
    try {
        date = format.parse(dateString);
    } catch (ParseException e) {
        throw new APIManagerAnalyticsUDFException("An error occurred while parsing string: " + dateString);
    }
    return date.getTime();
}

From source file:org.jivesoftware.util.JiveGlobals.java

/**
 * Formats a Date object to return a date and time using the global locale.
 *
 * @param date the Date to format.//w  w w  .  jav  a2 s  .  c o  m
 * @return a String representing the date and time.
 */
public static String formatDateTime(Date date) {
    if (dateTimeFormat == null) {
        if (properties != null) {
            dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, getLocale());
            dateTimeFormat.setTimeZone(getTimeZone());
        } else {
            DateFormat instance = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM,
                    getLocale());
            instance.setTimeZone(getTimeZone());
            return instance.format(date);
        }
    }
    return dateTimeFormat.format(date);
}

From source file:org.stanwood.media.store.mp4.MP4ITunesStore.java

/**
 * Used to add atoms to a MP4 file that makes iTunes see it as a TV Show episode
 * @param controller the media file controller
 * @param mp4Manager MP4 Manager/*from  ww w  .  j  a  v  a 2s . c  o  m*/
 * @param mp4File The MP4 file
 * @param episode The episode details
 * @throws MP4Exception Thrown if their is a problem updating the atoms
 */
public static void updateEpsiode(Controller controller, IMP4Manager mp4Manager, File mp4File, IEpisode episode)
        throws MP4Exception {

    DateFormat DF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); //$NON-NLS-1$
    DF.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$

    DateFormat DF1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
    DF.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$

    // http://code.google.com/p/mp4v2/wiki/iTunesMetadata
    List<IAtom> atoms = new ArrayList<IAtom>();
    IShow show = episode.getSeason().getShow();
    atoms.add(mp4Manager.createAtom(MP4AtomKey.MM_VERSION, STORE_VERSION.toString()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.MEDIA_TYPE, StikValue.TV_SHOW.getId()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.TV_EPISODE_ID, episode.getEpisodeId()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.TV_SHOW_NAME, show.getName()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.TV_SEASON, episode.getSeason().getSeasonNumber()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.TV_EPISODE, episode.getEpisodeNumber()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.ARTIST, show.getName()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.ALBUM,
            MessageFormat.format("{0}, Series {1}", show.getName(), episode.getSeason().getSeasonNumber()))); //$NON-NLS-1$
    atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_ALBUM,
            MessageFormat.format("{0}, Series {1}", show.getName(), episode.getSeason().getSeasonNumber()))); //$NON-NLS-1$
    atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_ARTIST, show.getName()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.ALBUM_ARTIST, show.getName()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_ALBUM_ARTIST, show.getName()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.TRACK_NUMBER, (short) episode.getEpisodeNumber(), (short) 0));
    //      atoms.add(mp4Manager.createAtom(MP4AtomKey.GAPLESS_PLAYBACK, false));
    //      atoms.add(mp4Manager.createAtom(MP4AtomKey.COMPILATION, false));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.DISK_NUMBER, (short) 1, (short) 1));
    if (episode.getDate() != null) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.RELEASE_DATE, DF.format(episode.getDate())));
    }
    atoms.add(mp4Manager.createAtom(MP4AtomKey.PURCHASED_DATE, DF1.format(getPurchasedDate(mp4File))));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.NAME, episode.getTitle()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_NAME, episode.getTitle()));
    if (show.getLongSummary() != null) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DESCRIPTION_STORE, show.getLongSummary()));
    } else if (show.getShortSummary() != null) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DESCRIPTION_STORE, show.getShortSummary()));
    }
    if (episode.getSummary() != null && episode.getSummary().length() > 0) {

        atoms.add(
                mp4Manager.createAtom(MP4AtomKey.DESCRIPTION, getShortDescription(episode.getSummary(), 100)));
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DESCRIPTION_LONG, episode.getSummary()));
    }

    for (Certification cert : show.getCertifications()) {
        String value = certToItunesCert(cert);
        if (value != null) {
            atoms.add(mp4Manager.createAtom(MP4AtomKey.CERTIFICATION, value));
        }
    }
    //      atoms.add(new Atom("rtng", )); // None = 0, clean = 2, explicit  = 4

    if (episode.getSeason().getShow().getGenres().size() > 0) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.GENRE_USER_DEFINED,
                episode.getSeason().getShow().getGenres().get(0)));
        atoms.add(mp4Manager.createAtom(MP4AtomKey.CATEGORY, episode.getSeason().getShow().getGenres().get(0)));
    }

    IMediaFileInfo info = null;
    ;
    try {
        if (controller != null) {
            info = controller.getMediaFileInformation(mp4File);
        }
    } catch (StanwoodException e) {
        log.error(Messages.getString("MP4ITunesStore.UnableReadMediaInfo"), e); //$NON-NLS-1$
    }
    String flavour = getFileFlavor(mp4File, info);
    genericAtoms(info, mp4Manager, atoms, flavour);

    StringBuilder iTuneMOVIValue = new StringBuilder();
    appendHeader(iTuneMOVIValue);
    iTuneMOVIValue.append("<dict>" + FileHelper.LS); //$NON-NLS-1$
    iTuneMOVIValue.append("    <key>asset-info</key>" + FileHelper.LS); //$NON-NLS-1$
    genericFileInfo(info, mp4File, flavour, iTuneMOVIValue);
    if (episode.getActors() != null && episode.getActors().size() > 0) {
        iTuneMOVIValue.append("    <key>cast</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <array>" + FileHelper.LS); //$NON-NLS-1$
        for (Actor actor : episode.getActors()) {
            iTuneMOVIValue.append("        <dict>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <key>name</key>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <string>" + actor.getName() + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
            iTuneMOVIValue.append("        </dict>" + FileHelper.LS); //$NON-NLS-1$
        }
        iTuneMOVIValue.append("    </array>" + FileHelper.LS); //$NON-NLS-1$
    }
    if (episode.getDirectors() != null && episode.getDirectors().size() > 0) {
        iTuneMOVIValue.append("    <key>directors</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <array>" + FileHelper.LS); //$NON-NLS-1$
        for (String director : episode.getDirectors()) {
            iTuneMOVIValue.append("        <dict>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <key>name</key>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <string>" + director + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
            iTuneMOVIValue.append("        </dict>" + FileHelper.LS); //$NON-NLS-1$
        }
        iTuneMOVIValue.append("    </array>" + FileHelper.LS); //$NON-NLS-1$
    }
    if (show.getStudio() != null) {
        iTuneMOVIValue.append("    <key>studio</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <string>" + show.getStudio() + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
    }

    iTuneMOVIValue.append("</dict>" + FileHelper.LS); //$NON-NLS-1$
    iTuneMOVIValue.append("</plist>" + FileHelper.LS); //$NON-NLS-1$
    atoms.add(mp4Manager.createAtom(MP4AtomKey.INFO, iTuneMOVIValue.toString()));

    IAtom artworkAtom = getArtworkAtom(mp4Manager, mp4File, episode);
    if (artworkAtom != null) {
        atoms.add(artworkAtom);
    }
    mp4Manager.update(mp4File, atoms);
}

From source file:org.stanwood.media.store.mp4.MP4ITunesStore.java

/**
 * Used to add atoms to a MP4 file that makes iTunes see it as a Film. It also removes any artwork before adding the
 * Film atoms and artwork./* w  ww .j av  a 2 s  .  c o m*/
 * @param controller The media controller
 * @param mp4Manager MP4 Manager
 * @param mp4File The MP4 file
 * @param film The film details
 * @param part The part number of the film, or null if it does not have parts
 * @throws MP4Exception Thrown if their is a problem updating the atoms
 */
public static void updateFilm(Controller controller, IMP4Manager mp4Manager, File mp4File, IFilm film,
        Integer part) throws MP4Exception {
    DateFormat DF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); //$NON-NLS-1$
    DF.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$

    DateFormat DF1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
    DF1.setTimeZone(TimeZone.getTimeZone("UTC")); //$NON-NLS-1$

    List<IAtom> atoms = new ArrayList<IAtom>();
    atoms.add(mp4Manager.createAtom(MP4AtomKey.MM_VERSION, STORE_VERSION.toString()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.MEDIA_TYPE, StikValue.SHORT_FILM.getId()));
    //      atoms.add(mp4Manager.createAtom(MP4AtomKey.GAPLESS_PLAYBACK, false));
    //      atoms.add(mp4Manager.createAtom(MP4AtomKey.COMPILATION, false));
    if (film.getDate() != null) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.RELEASE_DATE, DF.format(film.getDate())));
    }
    atoms.add(mp4Manager.createAtom(MP4AtomKey.PURCHASED_DATE, DF1.format(getPurchasedDate(mp4File))));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.NAME, film.getTitle()));
    atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_NAME, film.getTitle()));
    if (film.getSummary() != null && film.getSummary().length() > 0) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DESCRIPTION, film.getSummary()));
    }
    if (film.getDescription() != null && film.getDescription().length() > 0) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DESCRIPTION_LONG, film.getDescription()));
    }
    if (film.getDirectors() != null) {
        for (String director : film.getDirectors()) {
            atoms.add(mp4Manager.createAtom(MP4AtomKey.ARTIST, director));
            atoms.add(mp4Manager.createAtom(MP4AtomKey.SORT_ARTIST, director));
        }
    }

    for (Certification cert : film.getCertifications()) {
        String value = certToItunesCert(cert);
        if (value != null) {
            atoms.add(mp4Manager.createAtom(MP4AtomKey.CERTIFICATION, value));
        }
    }

    //      atoms.add(mp4Manager.createAtom("rtng", )); // None = 0, clean = 2, explicit  = 4
    if (part != null) {
        byte total = 0;
        for (VideoFile vf : film.getFiles()) {
            if (vf.getPart() != null && vf.getPart() > total) {
                total = (byte) (int) vf.getPart();
            }
        }

        if (part > total) {
            total = (byte) (int) part;
        }
        atoms.add(mp4Manager.createAtom(MP4AtomKey.DISK_NUMBER, (byte) (int) part, total));
    }

    if (film.getPreferredGenre() != null) {
        atoms.add(mp4Manager.createAtom(MP4AtomKey.GENRE_USER_DEFINED, film.getPreferredGenre()));
        atoms.add(mp4Manager.createAtom(MP4AtomKey.CATEGORY, film.getPreferredGenre()));
    } else {
        if (film.getGenres().size() > 0) {
            atoms.add(mp4Manager.createAtom(MP4AtomKey.GENRE_USER_DEFINED, film.getGenres().get(0)));
            atoms.add(mp4Manager.createAtom(MP4AtomKey.CATEGORY, film.getGenres().get(0)));
        }
    }
    IMediaFileInfo info = null;
    try {
        if (controller != null) {
            info = controller.getMediaFileInformation(mp4File);
        }
    } catch (StanwoodException e) {
        log.error(Messages.getString("MP4ITunesStore.UnableReadMediaInfo"), e); //$NON-NLS-1$
    }
    String flavour = getFileFlavor(mp4File, info);
    genericAtoms(info, mp4Manager, atoms, flavour);

    StringBuilder iTuneMOVIValue = new StringBuilder();
    appendHeader(iTuneMOVIValue);
    iTuneMOVIValue.append("<dict>" + FileHelper.LS); //$NON-NLS-1$
    iTuneMOVIValue.append("    <key>asset-info</key>" + FileHelper.LS); //$NON-NLS-1$
    genericFileInfo(info, mp4File, flavour, iTuneMOVIValue);
    if (film.getActors() != null && film.getActors().size() > 0) {
        iTuneMOVIValue.append("    <key>cast</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <array>" + FileHelper.LS); //$NON-NLS-1$
        for (Actor actor : film.getActors()) {
            iTuneMOVIValue.append("        <dict>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <key>name</key>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <string>" + actor.getName() + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
            iTuneMOVIValue.append("        </dict>" + FileHelper.LS); //$NON-NLS-1$
        }
        iTuneMOVIValue.append("    </array>" + FileHelper.LS); //$NON-NLS-1$
    }
    if (film.getDirectors() != null && film.getDirectors().size() > 0) {
        iTuneMOVIValue.append("    <key>directors</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <array>" + FileHelper.LS); //$NON-NLS-1$
        for (String director : film.getDirectors()) {
            iTuneMOVIValue.append("        <dict>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <key>name</key>" + FileHelper.LS); //$NON-NLS-1$
            iTuneMOVIValue.append("            <string>" + director + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
            iTuneMOVIValue.append("        </dict>" + FileHelper.LS); //$NON-NLS-1$
        }
        iTuneMOVIValue.append("    </array>" + FileHelper.LS); //$NON-NLS-1$
    }
    if (film.getStudio() != null) {
        iTuneMOVIValue.append("    <key>studio</key>" + FileHelper.LS); //$NON-NLS-1$
        iTuneMOVIValue.append("    <string>" + film.getStudio() + "</string>" + FileHelper.LS); //$NON-NLS-1$ //$NON-NLS-2$
    }

    iTuneMOVIValue.append("</dict>" + FileHelper.LS); //$NON-NLS-1$
    iTuneMOVIValue.append("</plist>" + FileHelper.LS); //$NON-NLS-1$
    atoms.add(mp4Manager.createAtom(MP4AtomKey.INFO, iTuneMOVIValue.toString()));

    IAtom artworkAtom = getArtworkAtom(mp4Manager, mp4File, film);
    if (artworkAtom != null) {
        atoms.add(artworkAtom);
    }
    mp4Manager.update(mp4File, atoms);
}

From source file:org.kalypso.ogc.sensor.diagview.jfreechart.DateAxis.java

/**
 * Resets the timezone of this date axis. Considers tick-units as well as date-format overrides.
 *//*from  w w w.  j  a v  a  2  s  .  c  om*/
public void setTimezone(final TimeZone timezone) {
    final DateFormat df = getDateFormatOverride() == null ? null : getDateFormatOverride();
    if (df != null) {
        df.setTimeZone(timezone);
        setDateFormatOverride(df);
    }

    final TickUnitSource source = createStandardDateTickUnits(timezone);
    setStandardTickUnits(source);
}