SmbFileHandleImpl openUnshared ( int flags, int access, int sharing, int attrs, int options ) throws CIFSException { return openUnshared(getUncPath(), flags, access, sharing, attrs, options); }
SmbFileHandleImpl openUnshared ( int flags, int access, int sharing, int attrs, int options ) throws CIFSException { return openUnshared(getUncPath(), flags, access, sharing, attrs, options); }
private String createLocalPathForSMBPath(String s) { if (Sage.WINDOWS_OS) { try { return new SmbFile(s).getUncPath(); } catch (Exception e) { if (Sage.DBG) System.out.println("ERROR w/ SMB URL:" + e); return s; } } String smbPrefix = Sage.get("linux/smb_mount_root", "/tmp/sagetv_shares/"); s = s.substring("smb://".length()); // Now modify the paths so it's only the share, not the subdirectory too int s1 = s.indexOf('/'); int s2 = s.indexOf('/', s1 + 1); return smbPrefix + s.substring(0, s2).toLowerCase(); }
log.debug("renameTo: " + getUncPath() + " -> " + dest.getUncPath()); req.setFileInformation(new FileRenameInformation2(dest.getUncPath().substring(1), replace)); withOpen(sh, Smb2CreateRequest.FILE_OPEN, FILE_WRITE_ATTRIBUTES | DELETE, FILE_SHARE_READ | FILE_SHARE_WRITE, req); sh.send(new SmbComRename(sh.getConfig(), getUncPath(), dest.getUncPath()), new SmbComBlankResponse(sh.getConfig()));
log.debug("renameTo: " + getUncPath() + " -> " + dest.getUncPath()); req.setFileInformation(new FileRenameInformation2(dest.getUncPath().substring(1), replace)); withOpen(sh, Smb2CreateRequest.FILE_OPEN, FILE_WRITE_ATTRIBUTES | DELETE, FILE_SHARE_READ | FILE_SHARE_WRITE, req); sh.send(new SmbComRename(sh.getConfig(), getUncPath(), dest.getUncPath()), new SmbComBlankResponse(sh.getConfig()));
@SuppressWarnings ( "unchecked" ) protected <T extends ServerMessageBlock2Response> T withOpen ( SmbTreeHandleImpl th, int createDisposition, int createOptions, int fileAttributes, int desiredAccess, int shareAccess, ServerMessageBlock2Request<T> first, ServerMessageBlock2Request<?>... others ) throws CIFSException { Smb2CreateRequest cr = new Smb2CreateRequest(th.getConfig(), getUncPath()); try { cr.setCreateDisposition(createDisposition); Smb2CloseRequest closeReq = new Smb2CloseRequest(th.getConfig(), getUncPath()); closeReq.setCloseFlags(Smb2CloseResponse.SMB2_CLOSE_FLAG_POSTQUERY_ATTIB); cur.chain(closeReq);
@SuppressWarnings ( "unchecked" ) protected <T extends ServerMessageBlock2Response> T withOpen ( SmbTreeHandleImpl th, int createDisposition, int createOptions, int fileAttributes, int desiredAccess, int shareAccess, ServerMessageBlock2Request<T> first, ServerMessageBlock2Request<?>... others ) throws CIFSException { Smb2CreateRequest cr = new Smb2CreateRequest(th.getConfig(), getUncPath()); try { cr.setCreateDisposition(createDisposition); Smb2CloseRequest closeReq = new Smb2CloseRequest(th.getConfig(), getUncPath()); closeReq.setCloseFlags(Smb2CloseResponse.SMB2_CLOSE_FLAG_POSTQUERY_ATTIB); cur.chain(closeReq);
new SmbComSetInformation(dh.getConfig(), dest.getUncPath(), attrs, mtime), new SmbComSetInformationResponse(dh.getConfig()));
new SmbComSetInformation(dh.getConfig(), dest.getUncPath(), attrs, mtime), new SmbComSetInformationResponse(dh.getConfig()));
new SmbComSetInformation(th.getConfig(), getUncPath(), attrs, mtime - th.getServerTimeZoneOffset()), new SmbComSetInformationResponse(th.getConfig()));
new SmbComSetInformation(th.getConfig(), getUncPath(), attrs, mtime - th.getServerTimeZoneOffset()), new SmbComSetInformationResponse(th.getConfig()));