Advertisement
mishkakun

Untitled

Feb 11th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.31 KB | None | 0 0
  1. // theirpic is an Option[ByteString]
  2. Try (theirpic.map(_.toArray).foreach { pic =>
  3.                   val fos = new FileOutputStream("img_avatar_" + user.uid)
  4.                   fos.write(pic)
  5.                 }) recover {
  6.                   case _ => logger.warn("Couldn't store new user's avatar.")
  7.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement