public class ClientSmartFile extends Object implements csbase.logic.ClientFile
Operações de IO: Sempre tenta utilizar o mounting point definido em
localProjectPath. Caso não consiga, tem o comportamento de ClientProjectFile
Operação de controle: Em geral, repassa a ação para o ClientProjectFile
original.
Deve ser instanciada sempre pelo método create() de
ClientSmartFileFactory
| Constructor and Description |
|---|
ClientSmartFile(csbase.logic.ClientProjectFile cpf,
csbase.logic.ClientOptimizationMode optimizationMode,
String localProjectPath)
Construtor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canExecute() |
boolean |
canRead() |
boolean |
canWrite() |
void |
close(boolean force) |
boolean |
exists() |
csbase.logic.ClientFile[] |
getChildren()
- Repassa o controle sempre ao clientProjectFile (confirmar
isso!)
|
csbase.logic.ClientFileType |
getClientFileType() |
ClientLocalFile |
getClientLocalFile() |
csbase.logic.ClientProjectFile |
getClientProjectFile() |
InputStream |
getInputStream() |
String |
getLocalPath() |
long |
getModificationDate() |
String |
getName() |
csbase.logic.ClientOptimizationMode |
getOptimizationMode() |
OutputStream |
getOutputStream() |
csbase.logic.ClientFile |
getParent() |
String[] |
getPath() |
String |
getStringPath() |
String |
getType() |
boolean |
isDirectory() |
void |
open(boolean readOnly) |
long |
position() |
void |
position(long newPosition) |
int |
read(byte[] dst,
int off,
int len,
long position) |
int |
read(byte[] dst,
long position) |
long |
size() |
boolean |
testOptimization()
Faz um teste, tentando abrir o arquivo.
|
void |
write(byte[] src,
int off,
int len,
long position) |
void |
write(byte[] src,
long position) |
public ClientSmartFile(csbase.logic.ClientProjectFile cpf,
csbase.logic.ClientOptimizationMode optimizationMode,
String localProjectPath)
ClientSmartFileFactory.cpf - ClientProjectFile que será utilizado para acesso ao projetooptimizationMode - Modo de otimizaçãolocalProjectPath - Caminho da área local de projetospublic csbase.logic.ClientProjectFile getClientProjectFile()
public ClientLocalFile getClientLocalFile()
public csbase.logic.ClientFile[] getChildren()
throws Exception
getChildren in interface csbase.logic.ClientFileExceptionpublic InputStream getInputStream() throws IOException
getInputStream in interface csbase.logic.ClientFileIOExceptionpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface csbase.logic.ClientFileIOExceptionpublic boolean exists()
throws IOException
exists in interface csbase.logic.ClientFileIOExceptionpublic long getModificationDate()
getModificationDate in interface csbase.logic.ClientFilepublic String getName()
getName in interface csbase.logic.ClientFilepublic csbase.logic.ClientFile getParent()
getParent in interface csbase.logic.ClientFilepublic String[] getPath()
getPath in interface csbase.logic.ClientFilepublic String getStringPath()
getStringPath in interface csbase.logic.ClientFilepublic String getLocalPath()
public String getType()
getType in interface csbase.logic.ClientFilepublic boolean isDirectory()
isDirectory in interface csbase.logic.ClientFilepublic boolean canRead()
canRead in interface csbase.logic.ClientFilepublic boolean canWrite()
canWrite in interface csbase.logic.ClientFilepublic boolean canExecute()
canExecute in interface csbase.logic.ClientFilepublic boolean testOptimization()
throws RemoteException
canRead() do arquivo localRemoteException - Em caso de erro no acesso a arquivo de projetopublic void open(boolean readOnly)
throws Exception
open in interface csbase.logic.ClientFileExceptionpublic int read(byte[] dst,
long position)
throws Exception
read in interface csbase.logic.ClientFileExceptionpublic int read(byte[] dst,
int off,
int len,
long position)
throws Exception
read in interface csbase.logic.ClientFileExceptionpublic void close(boolean force)
throws IOException
close in interface csbase.logic.ClientFileIOExceptionpublic long size()
size in interface csbase.logic.ClientFilepublic csbase.logic.ClientFileType getClientFileType()
getClientFileType in interface csbase.logic.ClientFilepublic void write(byte[] src,
int off,
int len,
long position)
throws IOException,
csbase.exception.project.FileLockedException
write in interface csbase.logic.ClientFileIOExceptioncsbase.exception.project.FileLockedExceptionpublic void write(byte[] src,
long position)
throws IOException,
csbase.exception.project.FileLockedException
write in interface csbase.logic.ClientFileIOExceptioncsbase.exception.project.FileLockedExceptionpublic long position()
throws IOException
position in interface csbase.logic.ClientFileIOExceptionpublic void position(long newPosition)
throws IOException
position in interface csbase.logic.ClientFileIOExceptionpublic csbase.logic.ClientOptimizationMode getOptimizationMode()
Copyright © 2016. All rights reserved.