Skip to content

Commit 95f2e08

Browse files
committed
* minor GridFSStreamObserver update
1 parent d83f409 commit 95f2e08

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/scala/com/sfxcode/nosql/mongo/gridfs/GridFSStreamObserver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import com.typesafe.scalalogging.LazyLogging
88
import org.mongodb.scala.Observer
99

1010
case class GridFSStreamObserver(outputStream: OutputStream) extends Observer[ByteBuffer] with LazyLogging {
11-
val completed = new AtomicBoolean(false)
11+
val completed = new AtomicBoolean(false)
1212
val resultLength = new AtomicLong(0)
1313

1414
override def onNext(buffer: ByteBuffer): Unit = {

src/test/scala/com/sfxcode/nosql/mongo/gridfs/GridfsDatabaseFunctions.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ trait GridfsDatabaseFunctions {
2929
}
3030

3131
def downloadImage(id: ObjectId, path: String): Unit = {
32-
val file = File(path)
33-
val start = System.currentTimeMillis()
34-
val size: Int = ImageFilesDAO.downloadToStream(id, file.newOutputStream)
32+
val file = File(path)
33+
val start = System.currentTimeMillis()
34+
val size: Long = ImageFilesDAO.downloadToStream(id, file.newOutputStream)
3535

3636
println(
3737
"file: %s with size %s Bytes written in %s ms "
38-
.format(file.pathAsString, size, System.currentTimeMillis() - start))
38+
.format(file.pathAsString, size, System.currentTimeMillis() - start)
39+
)
3940
}
4041

4142
def findImage(id: ObjectId): GridFSFile = ImageFilesDAO.findById(id)

0 commit comments

Comments
 (0)