Examples of FileException


Examples of org.gradle.internal.nativeintegration.filesystem.FileException

public class Jdk7FileCanonicalizer implements FileCanonicalizer {
    public File canonicalize(File file) throws FileException {
        try {
            return file.toPath().toRealPath().toFile();
        } catch (IOException e) {
            throw new FileException(String.format("Could not canonicalize file %s.", file), e);
        }
    }
View Full Code Here

Examples of org.gradle.internal.nativeintegration.filesystem.FileException

class FallbackFileCanonicalizer implements FileCanonicalizer {
    public File canonicalize(File file) throws FileException {
        try {
            return file.getCanonicalFile();
        } catch (IOException e) {
            throw new FileException(String.format("Could not canonicalize file %s.", file), e);
        }
    }
View Full Code Here

Examples of org.gradle.internal.nativeintegration.filesystem.FileException

    public void createSymbolicLink(File link, File target) {
        try {
            symlink.symlink(link, target);
        } catch (Exception e) {
            throw new FileException(String.format("Could not create symlink from '%s' to '%s'.", link.getPath(), target.getPath()), e);
        }
    }
View Full Code Here

Examples of org.gradle.internal.nativeintegration.filesystem.FileException

    public int getUnixMode(File f) {
        try {
            return stat.getUnixMode(f);
        } catch (Exception e) {
            throw new FileException(String.format("Could not get file mode for '%s'.", f), e);
        }
    }
View Full Code Here

Examples of org.gradle.internal.nativeintegration.filesystem.FileException

    public void chmod(File f, int mode) {
        try {
            chmod.chmod(f, mode);
        } catch (Exception e) {
            throw new FileException(String.format("Could not set file mode %o on '%s'.", mode, f), e);
        }
    }
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileException

    //test response to a FileException of RESTFileService.deleteFile(...)
    public void testDeleteFileServiceProblem() throws Exception {
        RESTFileService restService = new RESTFileService();
        List<Object> requestMocks = createRequestMocks();
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException("Something went wrong", new NullPointerException());
        fileService.deleteFile(EasyMock.same("somePackage"), EasyMock.same("myFile.tmp"));
        EasyMock.expectLastCall().andThrow(exception).once();
        requestMocks.add(fileService);
        restService.setFileService(fileService);
        Object[] mocks = requestMocks.toArray();
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileException

    //test response to a FileException of RESTFileService.getFiles(...)
    public void testGetFilesServiceProblem() throws Exception {
        RESTFileService restService = new RESTFileService();
        List<Object> requestMocks = createRequestMocks();
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException();
        EasyMock.expect(fileService.loadFilesByType(EasyMock.same("somePackage"), EasyMock.same("tmp"))).
            andThrow(exception);
        requestMocks.add(fileService);
        restService.setFileService(fileService);
        Object[] mocks = requestMocks.toArray();
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileException

    //test response to a FileException for RESTFileService.getFile(...)
    public void testGetFileServiceProblem() throws Exception {
        RESTFileService restService = new RESTFileService();
        List<Object> requestMocks = createRequestMocks();
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException(new NullPointerException());
        EasyMock.expect(fileService.loadFile(EasyMock.same("somePackage"), EasyMock.same("myFile.tmp"))).
            andThrow(exception);
        requestMocks.add(fileService);
        restService.setFileService(fileService);
        Object[] mocks = requestMocks.toArray();
View Full Code Here

Examples of org.jbpm.formbuilder.server.file.FileException

    public void testSaveFileServiceProblem() throws Exception {
        byte[] bstream = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9};
        String fileName = "fileName";       
        RESTFileService restService = createSaveFileMockService(bstream, fileName, null, true);
        FileService fileService = EasyMock.createMock(FileService.class);
        FileException exception = new FileException();
        EasyMock.expect(fileService.storeFile(EasyMock.eq("somePackage"), EasyMock.eq("fileName"), EasyMock.same(bstream))).
            andThrow(exception).once();
        restService.setFileService(fileService);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
View Full Code Here

Examples of org.webharvest.exception.FileException

    }

    private Variable executeFileList(String filePath, String listFilter, boolean listFiles, boolean listDirs, boolean listRecursive) {
        File dir = new File(filePath);
        if ( !dir.exists() ) {
            throw new FileException("Directory \"" + dir + "\" doesn't exist!");
        } else if ( !dir.isDirectory() ) {
            throw new FileException("\"" + dir + "\" is not directory!");
        }

        Collection collection = listFiles(dir, new CommandPromptFilenameFilter(listFilter), listRecursive);
        TreeSet sortedFileNames = new TreeSet();
        Iterator iterator = collection.iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.