0

I want to find the size of files using the length() function of java.io.File class. But the file I have in my code is of a different package (com.xyz.archway.objectmodel.host.filesystem.File) and does not have any function for determining the file size. How do I inject properties of java.io.File into an object of com.xyz.archway.objectmodel.host.filesystem.File?

import java.io.File;
@EJB
private GetFilesForApplicationCommandBean getfilesforapp;
.
.
.
.
Set<com.xyz.archway.objectmodel.host.filesystem.File> setfile =  getfilesforapp.getFiles(tempapp, true);
for(com.xyz.archway.objectmodel.host.filesystem.File file : setfile)
    {
        size = size + file.length(); ----->error`       
    }
 return size;

0 Answers0