CreateNode recursively creates parents if they do not already exist Only applicable to COLLECTION inside a structured storage (need to create .pydio hidden files)
(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption)
| 132 | // CreateNode recursively creates parents if they do not already exist |
| 133 | // Only applicable to COLLECTION inside a structured storage (need to create .pydio hidden files) |
| 134 | func (m *Handler) CreateNode(ctx context.Context, in *tree.CreateNodeRequest, opts ...grpc.CallOption) (*tree.CreateNodeResponse, error) { |
| 135 | if info, er := nodes.GetBranchInfo(ctx, "in"); er == nil && (info.FlatStorage || info.Binary || info.IsInternal()) || in.Node.IsLeaf() { |
| 136 | resp, err := m.Next.CreateNode(ctx, in, opts...) |
| 137 | if err != nil || !nodes.IsFlatStorage(ctx, "in") { |
| 138 | return resp, err |
| 139 | } |
| 140 | // Handle input metadata, unless specified (typically when creating resources at Move) |
| 141 | if !nodes.HasSkipDefaultMeta(ctx) { |
| 142 | _, err = m.getMetaClient().ExtractAndPut(ctx, resp.GetNode(), nodes.GetContextWorkspaceOrNil(ctx, "in"), in.GetNode().GetMetaStore(), meta.ExtractNodeMetadata) |
| 143 | } |
| 144 | return resp, err |
| 145 | } |
| 146 | if e := m.createParentIfNotExist(ctx, in.GetNode().Clone(), in.GetIndexationSession()); e != nil { |
| 147 | return nil, e |
| 148 | } |
| 149 | return m.Next.CreateNode(ctx, in, opts...) |
| 150 | } |
| 151 | |
| 152 | // PutObject eventually creates an index N, captures body to extract Mime Type and compute custom Hash |
| 153 | func (m *Handler) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (models.ObjectInfo, error) { |
nothing calls this directly
no test coverage detected