<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kazunegio</author_name>
  <author_url>https://blog.hatena.ne.jp/kazunegio/</author_url>
  <blog_title>それでもjavaが好き</blog_title>
  <blog_url>https://kazunegio.hatenadiary.org/</blog_url>
  <categories>
    <anon>java</anon>
    <anon>io</anon>
  </categories>
  <description>ファイルの拡張子が必要なものであるかを判断する場合、Fileクラスに拡張子を取得するメソッドがないので結局ファイル名から拡張子を取得するのですが、その時に気にした方が良いかも知れないことのメモ。 File#getName()よりもFile#getPath()を用いた方が良い FileクラスはStringフィールドでpathを保持しており、getPath()はそれをそのまま返しているのですが、getName()はsubstringしたものを返します。 この場合は、ファイル名のみを切り出してもらう必要はないため、余計なオブジェクトを生成しないgetPath()を用いた方が良い。 ちなみにFileク…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkazunegio.hatenadiary.org%2Fentry%2F20070712%2F1184221419&quot; title=&quot;ファイルの拡張子の判別方法 - それでもjavaが好き&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2007-07-12 15:23:39</published>
  <title>ファイルの拡張子の判別方法</title>
  <type>rich</type>
  <url>https://kazunegio.hatenadiary.org/entry/20070712/1184221419</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
