use of javax.microedition.io.file.FileConnection in project CodenameOne by codenameone.
the class BlackBerryImplementation method openOutputStream.
/**
* @inheritDoc
*/
public OutputStream openOutputStream(Object connection, int offset) throws IOException {
FileConnection fc = (FileConnection) Connector.open((String) connection, Connector.READ_WRITE);
if (!fc.exists()) {
fc.create();
}
BufferedOutputStream o = new BufferedOutputStream(fc.openOutputStream(offset), (String) connection);
o.setConnection(fc);
return o;
}
use of javax.microedition.io.file.FileConnection in project CodenameOne by codenameone.
the class BlackBerryImplementation method mkdir.
/**
* @inheritDoc
*/
public void mkdir(String directory) {
FileConnection fc = null;
try {
if (!directory.endsWith("/")) {
directory += "/";
}
fc = (FileConnection) Connector.open(directory, Connector.READ_WRITE);
fc.mkdir();
} catch (IOException err) {
err.printStackTrace();
} finally {
cleanup(fc);
}
}
use of javax.microedition.io.file.FileConnection in project CodenameOne by codenameone.
the class BlackBerryImplementation method setHidden.
/**
* @inheritDoc
*/
public void setHidden(String file, boolean h) {
FileConnection fc = null;
try {
fc = (FileConnection) Connector.open(file, Connector.READ_WRITE);
fc.setHidden(h);
} catch (IOException err) {
err.printStackTrace();
} finally {
cleanup(fc);
}
}
use of javax.microedition.io.file.FileConnection in project CodenameOne by codenameone.
the class BlackBerryImplementation method rename.
/**
* @inheritDoc
*/
public void rename(String file, String newName) {
FileConnection fc = null;
try {
fc = (FileConnection) Connector.open(file, Connector.READ_WRITE);
fc.rename(newName);
} catch (IOException err) {
err.printStackTrace();
} finally {
cleanup(fc);
}
}
Aggregations