当前位置: 首页>>代码示例>>Java>>正文


Java ErrorCodes.ENOENT属性代码示例

本文整理汇总了Java中net.fusejna.ErrorCodes.ENOENT属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorCodes.ENOENT属性的具体用法?Java ErrorCodes.ENOENT怎么用?Java ErrorCodes.ENOENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.fusejna.ErrorCodes的用法示例。


在下文中一共展示了ErrorCodes.ENOENT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readdir

@Override
public int readdir(String path, DirectoryFiller filler) {
    Node node = root.find(path);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    if (!node.isDir()) {
        return -ErrorCodes.ENOTDIR();
    }

    if (!node.isInitDone()) {
        node.init();
    }
    return node.readdir(filler);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:16,代码来源:FuseIotFS.java

示例2: write

@Override
public int write(String path, ByteBuffer buf, long bufSize,
		long writeOffset, FileInfoWrapper info) {
	Node n = gdrive.findPath(path, info);
	if(n == null) return -ErrorCodes.ENOENT();
	if (n.isDirectory())
		return -ErrorCodes.EISDIR();
	try {
		synchronized (n) {
			File f = n.cache();
			RandomAccessFile aFile = new RandomAccessFile(f, "rw");
			FileChannel inChannel = aFile.getChannel();
			buf.limit((int)bufSize);
			int len = inChannel.write(buf, writeOffset);
			n.markDirty();
			n.size = aFile.length();
			aFile.close();
			return len;
		}
	} catch (IOException e) {
		e.printStackTrace();
		return -ErrorCodes.EAGAIN();
	}
}
 
开发者ID:tbutter,项目名称:gyingpan,代码行数:24,代码来源:FuseFS.java

示例3: rename

@Override
public int rename(final String path, final String newName)
{
	final MemoryPath p = getPath(path);
	if (p == null) {
		return -ErrorCodes.ENOENT();
	}
	final MemoryPath newParent = getParentPath(newName);
	if (newParent == null) {
		return -ErrorCodes.ENOENT();
	}
	if (!(newParent instanceof MemoryDirectory)) {
		return -ErrorCodes.ENOTDIR();
	}
	p.delete();
	p.rename(newName.substring(newName.lastIndexOf("/")));
	((MemoryDirectory) newParent).add(p);
	return 0;
}
 
开发者ID:lisgie,项目名称:ChallengeTask_Group2,代码行数:19,代码来源:MemoryFS.java

示例4: getattr

@Override
public int getattr(String path, StatWrapper stat) {
	Node n = gdrive.findPath(path, null);
	if (n == null)
		return -ErrorCodes.ENOENT();
	stat.setAllTimesMillis(n.lastModified);
	stat.size(n.getSize());
	if (n.isDirectory())
		stat.setMode(NodeType.DIRECTORY);
	else {
		if (n.isGoogleFile())
			stat.setMode(NodeType.FILE, true, false, false);
		else
			stat.setMode(NodeType.FILE, true, true, false);
	}
	return 0;
}
 
开发者ID:tbutter,项目名称:gyingpan,代码行数:17,代码来源:FuseFS.java

示例5: create

@Override
public int create(String path, ModeWrapper mode, FileInfoWrapper info) {
    Node node = root.find(path);
    if (node != null) {
        return -ErrorCodes.EEXIST();
    }

    int pos = path.lastIndexOf('/');
    if (pos < 0) {
        return -ErrorCodes.ENOENT();
    }
    String name = path.substring(pos + 1);
    if (name.length() < 1) {
        return -ErrorCodes.ENOENT();
    }
    path = path.substring(0, pos);
    if (path.length() < 1) {
        path = "/";
    }

    node = root.find(path);
    if (node == null || !node.isDir()) {
        return -ErrorCodes.ENOENT();
    }

    return node.create(name, mode, info);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:27,代码来源:FuseIotFS.java

示例6: getattr

@Override
public int getattr(String path, StatWrapper stat) {
    Node node = root.find(path, false);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    if (!node.isInitDone()) {
        node.init();
    }

    return node.getAttr(stat);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:13,代码来源:FuseIotFS.java

示例7: link

@Override
public int link(String path, String target) {
    Node targetNode = root.find(target);
    if (targetNode == null) {
        return -ErrorCodes.ENOENT();
    }

    Node node = root.find(path);
    if (node != null) {
        return -ErrorCodes.EEXIST();
    }

    int pos = path.lastIndexOf('/');
    if (pos < 0) {
        return -ErrorCodes.ENOENT();
    }
    String name = path.substring(pos + 1);
    if (name.length() < 1) {
        return -ErrorCodes.ENOENT();
    }
    path = path.substring(0, pos);
    if (path.length() < 1) {
        path = "/";
    }

    node = root.find(path);
    if (node == null || !node.isDir()) {
        return -ErrorCodes.ENOENT();
    }

    return node.link(name, targetNode);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:32,代码来源:FuseIotFS.java

示例8: mkdir

@Override
public int mkdir(String path, ModeWrapper mode) {
    Node node = root.find(path);
    if (node != null) {
        return -ErrorCodes.EEXIST();
    }

    int pos = path.lastIndexOf('/');
    if (pos < 0) {
        return -ErrorCodes.ENOENT();
    }
    String name = path.substring(pos + 1);
    if (name.length() < 1) {
        return -ErrorCodes.ENOENT();
    }
    path = path.substring(0, pos);
    if (path.length() < 1) {
        path = "/";
    }

    node = root.find(path);
    if (node == null || !node.isDir()) {
        return -ErrorCodes.ENOENT();
    }

    return node.mkdir(name, mode);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:27,代码来源:FuseIotFS.java

示例9: open

@Override
public int open(String path, FileInfoWrapper info) {
    Node node = root.find(path);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    if (!node.isInitDone()) {
        node.init();
    }
    return node.open(path, info);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:12,代码来源:FuseIotFS.java

示例10: read

@Override
public int read(String path, ByteBuffer buffer, long size, long offset, FileInfoWrapper info) {
    Node node = root.find(path);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    return node.read(path, buffer, size, offset, info);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:9,代码来源:FuseIotFS.java

示例11: readlink

@Override
public int readlink(String path, ByteBuffer buffer, long size) {
    Node node = root.find(path, false);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    if (!node.isInitDone()) {
        node.init();
    }

    return node.readlink(buffer, size);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:13,代码来源:FuseIotFS.java

示例12: release

@Override
public int release(String path, FileInfoWrapper info) {
    Node node = root.find(path);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    return node.release(path, info);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:9,代码来源:FuseIotFS.java

示例13: rmdir

@Override
public int rmdir(String path) {
    Node node = root.find(path, false);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    return node.rmdir(path);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:9,代码来源:FuseIotFS.java

示例14: symlink

@Override
public int symlink(String path, String target) {
    Node node = root.find(target);
    if (node != null) {
        return -ErrorCodes.EEXIST();
    }

    int pos = target.lastIndexOf('/');
    if (pos < 0) {
        return -ErrorCodes.ENOENT();
    }
    String name = target.substring(pos + 1);
    if (name.length() < 1) {
        return -ErrorCodes.ENOENT();
    }
    String targetPath = target.substring(0, pos);
    if (targetPath.length() < 1) {
        targetPath = "/";
    }

    node = root.find(targetPath);
    if (node == null || !node.isDir()) {
        return -ErrorCodes.ENOENT();
    }

    return node.symlink(name, path);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:27,代码来源:FuseIotFS.java

示例15: truncate

@Override
public int truncate(String path, long offset) {
    Node node = root.find(path);
    if (node == null) {
        return -ErrorCodes.ENOENT();
    }

    return node.truncate(path, offset);
}
 
开发者ID:awslabs,项目名称:aws-iot-fuse,代码行数:9,代码来源:FuseIotFS.java


注:本文中的net.fusejna.ErrorCodes.ENOENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。