package org.archboy.clobaframe.io.file.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.util.Date;
import org.archboy.clobaframe.io.file.FileBaseResourceInfo;

public class DefaultFileBaseResourceInfo implements FileBaseResourceInfo {

	protected File file;
	protected String mimeType;

	public DefaultFileBaseResourceInfo(File file, String mimeType) {
		this.file = file;
		this.mimeType = mimeType;
	}

	@Override
	public long getContentLength() {
		// get the length just in time.
		return file.length();
	}

	@Override
	public String getMimeType() {
		return mimeType;
	}

	@Override
	public InputStream getContent() throws IOException {
		return new FileInputStream(file);
	}

	@Override
	public InputStream getContent(long start, long length) throws IOException {
		return new PartialFileInputStream(file, start, length);
	}

	@Override
	public boolean isSeekable() {
		return true;
	}

	@Override
	public Date getLastModified() {
		// get the last modified time just in time.
		System.out.println("FILE:" + file.getName());
		System.out.println("	last mod:" + file.lastModified());
		Date date = new Date(file.lastModified());
		System.out.println("	last mod(date):" + date);
		
		try{
			Path path = Paths.get(file.toURI());
			FileTime ft = Files.getLastModifiedTime(path);
			long m = ft.toMillis();
			System.out.println(" --" + m);
			System.out.println(" --(date)" + new Date(m));
		}catch(IOException e){
			//
		}
		
		return date;
	}

	@Override
	public File getFile() {
		return file;
	}
	
}

@@ -1218,454 +1218,50 @@
 .%0A%09%09
-System.out.println(%22FILE:%22 + file.getName());%0A%09%09System.out.println(%22%09last mod:%22 + file.lastModified());%0A%09%09Date date = new Date(file.lastModified());%0A%09%09System.out.println(%22%09last mod(date):%22 + date);%0A%09%09%0A%09%09try%7B%0A%09%09%09Path path = Paths.get(file.toURI());%0A%09%09%09FileTime ft = Files.getLastModifiedTime(path);%0A%09%09%09long m = ft.toMillis();%0A%09%09%09System.out.println(%22 --%22 + m);%0A%09%09%09System.out.println(%22 --(date)%22 + new Date(m));%0A%09%09%7Dcatch(IOException e)%7B%0A%09%09%09//%0A%09%09%7D%0A%09%09
+Date date = new Date(file.lastModified());
 %0A%09%09r

Remove the debug code from "io" module.