I am writing a java code to retrieve an attachments from specified location to a file system. The attachment information is stored into database table column, like this
Number attachment_url
----------- -----------------------------------------------------------------
SAT-3 C:\test_attachments\SAT\SAT-368\thumbs\_thumb_63650.png
SAT-10 C:\test_attachments\SAT\thumbs\_ts63650.xls
SAT-89 C:\test_attachments\SAT\thumbs\mydoc.pdf
The file extension can be any.
I am able to fetch the attachment url and also able to create a folders. But how I can write the attachment to particular folder ?
File files = new File("E:\\Directory1\\" + m_Number);
if (!files.exists()) {
if (files.mkdirs()) {
System.out.println("Multiple directories are created!");
if (files.exists()) {
System.out.println("Directory exists");
if (files.canWrite()) {
Blob blob = resultSet.getBlob("att_url");
} else {
System.out.println("Access denied !!!");
}
}
} else {
System.out.println("Failed to create multiple directories!");
}
How can I achive this